Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Lord Karnus

Length of dynamic array

This topic is 6272 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know I've got to be doing something wrong, because I've not had this problem before! Plus I'm really tired, but I'm on a coding binge and want to get this! for example I have :
char* Array = new char [ SomeCrazyNumber ];
Now I want to determine the number of elements in the array without using the variable SomeCrazyNumber. When I try:
int Size = sizeof(Array)/sizeof(Array[0]);
This is ALWAYS 4 or 1, no matter the value of SomeCrazyNumber ! I know it's probably obvious, and I'll feel dumb when the answer is clear, but please help! Feel free to email me. Edited by - Lord Karnus on September 20, 2001 11:10:39 PM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!