Resetting arrays

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Dec 2005
Posts: 45
Reputation: ilikerps is an unknown quantity at this point 
Solved Threads: 0
ilikerps ilikerps is offline Offline
Light Poster

Resetting arrays

 
0
  #1
Dec 5th, 2005
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'?
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: Resetting arrays

 
0
  #2
Dec 5th, 2005
use the memset function.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 45
Reputation: ilikerps is an unknown quantity at this point 
Solved Threads: 0
ilikerps ilikerps is offline Offline
Light Poster

Re: Resetting arrays

 
0
  #3
Dec 5th, 2005
Thanks again, Wolfpack. Should I set the character to '\0' to make an empty array, though?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 598
Reputation: SpS is on a distinguished road 
Solved Threads: 32
SpS's Avatar
SpS SpS is offline Offline
Posting Pro

Re: Resetting arrays

 
0
  #4
Dec 5th, 2005
if its a character array then initialize it with '\0' and if its an integer array then initilize it with 0
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum


Views: 1716 | Replies: 3
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC