Q:

Consider the two statements and find the difference between them?

0

Consider the two statements and find the difference between them?

struct sStudentInfo
{
    char Name[12];
    int Age;
    float Weight;
    int RollNumber;
};
#define STUDENT_INFO struct sStudentInfo*
typedef struct sStudentInfo* studentInfo;
statement 1
STUDENT_INFO p1, p2;
statement 2
studentInfo q1, q2;

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

Both statements looking the same but actually, both are different from each other.

Statement 1 will be expanded to struct sStudentInfo * p1, p2. It means that p1 is a pointer to struct sStudentInfo but p2 is a variable of struct sStudentInfo.

In statement 2, both q1 and q2 will be a pointer to struct sStudentInfo.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now