Jump to content
  • Advertisement

Archived

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

Length of dynamic array

This topic is 6087 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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!