dynamically allocated memory fast way to fill with values

Started by
0 comments, last by CProgrammer 20 years, 6 months ago
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]
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
"The Gods Made Heavy Metal And They Saw That It Was Good They Said To Play It Louder Than Hell We Promised That We WouldWhen 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

This topic is closed to new replies.

Advertisement