
August 29th, 2002, 07:07 AM
|
|
Junior Member
|
|
Join Date: Aug 2002
Posts: 0
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
understanding struct?
hi..
i am taking over a project done by someone and reading the code done by her. however, i am rather weak in c programming and havin difficulties.. hope the community here can help..
what does this do
Code:
struct qmesg* recvmesg=(struct qmesg*)malloc(sizeof(struct qmesg));
i understand that "struct qmesg *recvmesg" is to initialisea struct pointer named "recvmesg" but i am not sure about the assignment part "=(struct qmesg*)malloc(sizeof(struct qmesg))"
**pls ignore this, i just realised that the statement is a formal syntax of malloc. always been using it without the casting ie
"struct qmesg* recvmesg = malloc(sizeof(struct qmesg));
|