Jump to content
  • Advertisement

Archived

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

CProgrammer

dynamically allocated memory fast way to fill with values

This topic is 5385 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 have an array: int **x; Now i know all the values i want to put in how can i do this in one go. Im thinking of something like: int y[] = { {1},{2} }; How can i transfer this to my problem. PS: x has already been used and the memory has been initialised. Do i have to make a temporary variable and then copy the content or is there a direct way? -CProgrammer [edited by - CProgrammer on October 22, 2003 2:36:46 AM]

Share this post


Link to post
Share on other sites
Advertisement
As for me, idea with temportary variable is good.




"The Gods Made Heavy Metal And They Saw That It Was Good They Said To Play It Louder Than Hell We Promised That We Would
When Losers Say Its Over With You Know That It’s A Lie The Gods Made Heavy Metal And It’s Never Gonna Die"

THE GODS MADE HEAVY METAL/by
ManOwaR

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!