typedef struct contactInfo
{
int number;
char id;
}ContactInfo;
This code defines 2 things:
- type named
ContactInfo - a
structwith the nameContactInfo
Pay attention to the difference in cand c!
In your code, you are using a mixed combination of both, which is allowed (although confusing IMHO).
struct, struct contactInfo. (ContactInfo) struct, .
. .
Visual Studio , () gcc - :
#include<stdlib.h>
typedef struct contactInfo
{
int number;
char id;
}ContactInfo;
void main()
{
ContactInfo nom,*ptr;
ptr=malloc(2*sizeof(ContactInfo));
}
( / )