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 |
How to calculate Total working time using Login and logout?
2 Answers CTS, Cygnus, Infosys, Signal Networks, TCS, Wipro,
Differentiate between new and malloc(), delete and free() ?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
write a program to swap bits in a character and return the value prototype of function char fun (char a, charb flag c) where fun returns a char, char a is a the value char b is the bit to be changed and flag c is the bit value for eg: x=fun(45,7,0) since 45 is 0010 0101 and ow x should contain the value 65 (0110 0101)
1 Answers Bosch, College School Exams Tests,
can you change name of main()?how?
WHOT IS CHAR?
Why isnt there a numbered, multi-level break statement to break out
Is there a built-in function in C that can be used for sorting data?
Is an array parameter is always "by reference" ?
write a program to remove duplicate from an ordered char array? in c
How can I find out the size of a file, prior to reading it in?
What is your stream meaning?