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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How variables are declared in c?

780


What is the explanation for prototype function in c?

745


What are the types of macro formats?

811


How can I find out how much free space is available on disk?

821


Write a program to print factorial of given number without using recursion?

775


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

1836


Why do we use return in c?

746


Write a program of prime number using recursion.

827


In C programming, what command or code can be used to determine if a number of odd or even?

826


What is variable declaration and definition in c?

691


What is use of #include in c?

822


How does free() know explain how much memory to release?

811


Tell me the use of bit field in c language?

833


Is r written in c?

894


Explain the meaning of keyword 'extern' in a function declaration.

922