Results 1 to 3 of 3
Say i have a function that takes in one arg
eg
func(int *numbers[]);
now is that arg an array of int pointers or a pointer to an array of ints?
...
- 09-05-2009 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 12
C++ ptr array question ***Solved***
Say i have a function that takes in one arg
eg
func(int *numbers[]);
now is that arg an array of int pointers or a pointer to an array of ints?
Thanks
****NOTE****
i found out its a pointer to an array of ints.
- 09-05-2009 #2Just Joined!
- Join Date
- Feb 2009
- Posts
- 13
its array of pointers I think...
- 09-08-2009 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
It's an array of pointers to ints. If it was a pointer to an array of ints it would either be int* numbers, or int numbers[]. In any of these cases, however, it is VERY bad that the function call doesn't have an argument that specifies how many entries there are in the array. That failure is a sure fire way to a buffer overflow security breach.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote