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

Answers were Sorted based on User's Feedback



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

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

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

Answer / guest

The first structure is named by a tag, the second by a typedef
name.

Is This Answer Correct ?    4 Yes 2 No

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

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

Post New Answer

More C Interview Questions

What is the use of gets and puts?

0 Answers  


Stimulate calculators to perform addition,subtraction,multiplication and division on two numbers using if/else statement?

1 Answers   IBM,


Why doesnt this code work?

0 Answers  


Explain the use of 'auto' keyword in c programming?

0 Answers  


Should I learn c before c++?

0 Answers  


What is dynamic memory allocation?

0 Answers  


Can we change the value of #define in c?

0 Answers  


What is meant by initialization and how we initialize a variable?

0 Answers  


What is conio h in c?

0 Answers  


How to write in a function declaration and in function call in which the function has 'n' number of varible or arguments?

2 Answers  


What is the difference between File pointer and Internal Charecter Pointer?

2 Answers   TATA,


Explain 'far' and 'near' pointers in c.

0 Answers  


Categories