0
What is typedef and how to use it
typedef in structure
5 Réponses
0
Shruti Nayak you can declare something which is not datatype in c++ as datatype... refer below :
typedef int nit; // now nit behaves as datatype like int
nit a = 55; // see wee declared a as of nit
cout << a;
follow same concept for structure and feel free to ask for any query
0
Ketan Lalcheta then how many bytes nit acquire memory
0
it behaves like int... so nit memory also depends upon compiler type....
0
is typedef is used only in structure in c language
0
Shruti Nayak no..it's not limited to structure..in above example, we have used it for int