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 register a keyword in c?
24.what is a void pointer? 25.why arithmetic operation can’t be performed on a void pointer? 26.differentiate between const char *a; char *const a; and char const *a; 27.compare array with pointer? 28.what is a NULL pointer? 29.what does ‘segmentation violation’ mean? 30.what does ‘Bus Error’ mean? 31.Define function pointers? 32.How do you initialize function pointers? Give an example? 33.where can function pointers be used?
write a program to convert a expression in polish notation (postfix) to inline (normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix
Is there a way to switch on strings?
write a c code "if you give a any decimal number then print that number in english alphabet"? ex: i/p: 552 o/p: five hundred fifty two ...
What is %lu in c?
What are all different types of pointers in c?
Toggle nth bit in a given integer - num
write a c program to find the sum of five entered numbers using an array named number
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
Why enum is used in c?
How many types of linked lists what are they? How many types of data structures?
18 Answers BSNL, Pivotal Software,