Posted: Tue Jun 21, 2005 6:40 pm Post subject: size of an array
does any one know the function to find the size of an array?
Sponsor Sponsor
wtd
Posted: Tue Jun 21, 2005 7:05 pm Post subject: Re: size of an array
The_$hit wrote:
does any one know the function to find the size of an array?
Use std::vector instead of an array.
1of42
Posted: Tue Jun 21, 2005 7:28 pm Post subject: (No subject)
To be more clear, there is no function to find the size of an array, since an array is just a glorified pointer. You have to manually keep track of the size of the array yourself.
Oh - use a vector
Cinjection
Posted: Tue Jun 21, 2005 7:53 pm Post subject: Re: size of an array
wtd wrote:
Use std::vector instead of an array.
Dude, you want to tell me why in all your C++ posts you use std:: ? Just put
code:
using namespace std;
Andy
Posted: Tue Jun 21, 2005 8:15 pm Post subject: (No subject)
because its more standard.. if we simply told them to use vector, then they'll come back saying it doesnt work and blah blah.. but if u use std::vector, then it'll work no matter what, plus it keeps the file size down
wtd
Posted: Tue Jun 21, 2005 8:22 pm Post subject: Re: size of an array
Cinjection wrote:
wtd wrote:
Use std::vector instead of an array.
Dude, you want to tell me why in all your C++ posts you use std:: ? Just put
code:
using namespace std;
Lots of stuff lives in the std namespace. I don't want all of it my namespace.
The_$hit
Posted: Tue Jun 21, 2005 8:25 pm Post subject: (No subject)
i need to use pointers tho.... and i need to se how many values are passed through the parameters. Is there any way of doing this with pointers or arrays?
wtd
Posted: Tue Jun 21, 2005 8:54 pm Post subject: (No subject)
How about showing us what you do have, or even describing what you're actually trying to accomplish.