What is the right way to declare a pointer and assign it an existing variable in the same line?
would this:
be the same as:Code:int *p = &e;
?Code:int *p; p = &e;
Thank you very much for your patience.
What is the right way to declare a pointer and assign it an existing variable in the same line?
would this:
be the same as:Code:int *p = &e;
?Code:int *p; p = &e;
Thank you very much for your patience.
Yes, they have the same net effect of making p point to e.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Thank you laserlight!