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 |
Explain what is the purpose of "extern" keyword in a function declaration?
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.
the data type used for unlimited value in c and how to do this program
What is the right way to use errno?
Explain what are the different file extensions involved when programming in c?
what information does the header files contain?
6 Answers BSNL, Cisco, GDA Technologies,
can we access one file to one directory?
Can a pointer be null?
#include<stdio.h> void main() { int =1; printf("%d%d%d",a++,++a,++a); }
char *p="name"; printf(p);
being a chemical engineer and with an aggregate of 80% why you opt for TCS and not your core industry?
Implement a function that returns the 5th element from the end in a singly linked list of integers in one pass.