What's the difference between struct x1 { ... }; and
typedef struct { ... } x2; ?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / guest
The first structure is named by a tag, the second by a typedef
name.
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / esperto informatico
in theory, for my opiniol the difference is connected to
the use of memory.... the correct and easy answer it could
be that the first define a struct and a second define a
struct type.... =).....
| Is This Answer Correct ? | 0 Yes | 3 No |
pick out the odd one out of the following a.malloc() b.calloc() c.free() d.realloc()
write a program to print %d ?
A woman had somany gloves and hats 22 red,34 blue, 45 white...there was power cut and she took a glove and how many gloves shud she take so that she gets a pair of glove fr each color??
What happens if a header file is included twice?
What is a structure member in c?
Tell me what are bitwise shift operators?
WHAT IS INT?
2.main { int x,j,k; j=k=6;x=2; x=j*k; printf("%d", x);
What is the difference between exit() and _exit()?
program in c to print 1 to 100 without using loop
Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ... } c.x=0; do{ /*x unaltered within theloop*/ ... }while(x==0); d.# define TRUE 0 ... while(TRUE){ .... }
wap in c to accept n number display the highest and lowest value