What's the difference between struct x1 { ... }; and
typedef struct { ... } x2; ?

Answer Posted / vikraman85

In the first its simply structure,by declaring structure
variable accessors we can access those elements inside the
structure..
eg.struct x1 a,b,c;
In the next one the x2 acts as a datatype..
b'coz of the typedef function..
we can use x2 as datatype for the further calculations like
int,float which are predefined datatypes,but this is
manually defined datatype..

Is This Answer Correct ?    16 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain high-order and low-order bytes.

670


What is a lvalue

665


Write a code of a general series where the next element is the sum of last k terms.

597


Is flag a keyword in c?

682


What is the difference between if else and switchstatement

1313






What is the size of enum in c?

624


Write a factorial program using C.

646


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

635


How can I make it pause before closing the program output window?

582


what are the advantages of a macro over a function?

648


c program for searching a student details among 10 student details

1657


What is meant by realloc()?

679


How can I get the current date or time of day in a c program?

653


Why clrscr is used in c?

588


What does %p mean?

596