Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (anonymous):

Quick C pointer question Say we have: p = &c;

OpenStudy (anonymous):

This assigns the address of c to the variable p, so p is a 'pointer' right?

OpenStudy (anonymous):

Then what would this be? int *p;

OpenStudy (anonymous):

p has to be a pointer and it should be declared bfore u assign it int *p is pretty much like int a .. int a would create an integer variable data type and int *p would create(allocates memory) a pointer

OpenStudy (anonymous):

ok i see so would it be like this? int *p; p = &c;

OpenStudy (anonymous):

yup

OpenStudy (anonymous):

actually it would be like int c; int *p; p=&c

OpenStudy (anonymous):

; :P

OpenStudy (anonymous):

oh right of course, thanks avinash!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!