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 |
Is this program statement valid? INT = 10.50;
triangle number finding program...
diff .between strcture and union
write a program to find the sum of the array elements in c language?
24 Answers ICT, Infosys, Wipro,
How can you return multiple values from a function?
What is a const pointer?
what are the compilation steps? ( i want inside the compiler )
Explain why can’t constant values be used to define an array’s initial size?
How to declare pointer variables?
Are pointers really faster than arrays?
Why do we use header files in c?
Write a program to print distinct words in an input along with their count in input in decreasing order of their count..