main()
{
struct
{
int i;
}abc;
(*abc)->i=10;
printf("%d",abc.i);
}

What is the output of this program?

Options
- address of i
- 10
- program will not compile
- None of the above


CORRECT ANSWER : program will not compile

Discussion Board
Answer & corerct code

-The answer is, program will not compile. It means error is occurred during compilation.

Following is the correct code:

main()
{
struct s
{
int i;
}abc;
struct s *pt=&abc;
pt->i=10;
printf("%d",abc.i);
}

After writing this correct code output will be 10.

Sapna 02-16-2017 05:18 AM

C

also syntax error,it is not correct syntax for struct

Aisha Syed 11-26-2014 11:05 AM

description

This is not the correct way to assign value to a pointer.We cannot directly assign value to a pointer.

Ritika Manchanda 09-24-2014 01:26 PM

c

very good probnlem\s

rajesh yadav 10-30-2013 11:48 PM

c

ever ans have description. why become this ans..because this is a programming language.

Awanish kumar 09-15-2013 03:03 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement