944,035 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 2321
  • C RSS
Dec 5th, 2005
0

Resetting arrays

Expand Post »
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'?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
ilikerps is offline Offline
45 posts
since Dec 2005
Dec 5th, 2005
0

Re: Resetting arrays

use the memset function.
Moderator
Reputation Points: 572
Solved Threads: 115
Mentally Challenged Mod.
WolfPack is offline Offline
1,559 posts
since Jun 2005
Dec 5th, 2005
0

Re: Resetting arrays

Thanks again, Wolfpack. Should I set the character to '\0' to make an empty array, though?
Reputation Points: 10
Solved Threads: 0
Light Poster
ilikerps is offline Offline
45 posts
since Dec 2005
Dec 5th, 2005
0

Re: Resetting arrays

if its a character array then initialize it with '\0' and if its an integer array then initilize it with 0
SpS
Reputation Points: 70
Solved Threads: 32
Posting Pro
SpS is offline Offline
598 posts
since Aug 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Array Struct Sort Help!! Urgent!
Next Thread in C Forum Timeline: Help with arrays





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC