954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Resetting arrays

How does one reset an array, to make it retain its size but get rid of all data it has stored?
Would one do it by setting all the array values to '\0'?

ilikerps
Light Poster
45 posts since Dec 2005
Reputation Points: 10
Solved Threads: 0
 

use the memset function.

WolfPack
Postaholic
Moderator
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
 

Thanks again, Wolfpack. Should I set the character to '\0' to make an empty array, though?

ilikerps
Light Poster
45 posts since Dec 2005
Reputation Points: 10
Solved Threads: 0
 

if its a character array then initialize it with '\0' and if its an integer array then initilize it with 0

SpS
Posting Pro
599 posts since Aug 2005
Reputation Points: 70
Solved Threads: 32
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You