"int (x*)[5];"
Is x a pointer to "int ...[]"?
"int (x*)[5];"
Is x a pointer to "int ...[]"?
Yes, x is a pointer to an int[5].Originally Posted by hchingwong
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Thank you laserlight.
Oh wait, I'm sorry. I misread. Actually, that should result in a compile error. I was thinking of:
Code:int (*x)[5];
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
HOPE YOU UNDERSTAND.......
By associating with wise people you will become wise yourself
It's fine to celebrate success but it is more important to heed the lessons of failure
We've got to put a lot of money into changing behavior
PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
IDE- Microsoft Visual Studio 2008 Express Edition
X seems like a pointer point to an integer array that contain 5 members.
Because complier give me an warning: "assignment from incompatible pointer type" in this case.
And this one pass without warning.Code:int (*x)[5]; int b[3]; x = &b;
This's the first time I ask a question on the forum. So,Code:int b[5];
thank you everybody.
HOPE YOU UNDERSTAND.......
By associating with wise people you will become wise yourself
It's fine to celebrate success but it is more important to heed the lessons of failure
We've got to put a lot of money into changing behavior
PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
IDE- Microsoft Visual Studio 2008 Express Edition
Identifier Type-- int
Name/Pointer--------- (x*) /*Can be a name or pointer to said type( this is needed to help set up the compiler to set up memory constraints */
Space/Memory used -------------[5] /* how much memory should the compiler set aside. If not initialized, then this must be assigned later or malloc must be used for the pointed to memory address */
Try this on for size:
Code:typedef int (*pfunc)(void); pfunc Foo;
Typedef
Last edited by slingerland3g; 12-07-2009 at 02:26 PM.