Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 size of an array
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
The_$hit




PostPosted: 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
Sponsor
sponsor
wtd




PostPosted: 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




PostPosted: 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 Wink
Cinjection




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: