Quick Qn bout arrays!

This is a discussion on Quick Qn bout arrays! within the C Programming forums, part of the General Programming Boards category; hello! what is the best way to clear an array so that i can fill it with new values?...

  1. #1
    Mr_J_Cake
    Guest

    Lightbulb Quick Qn bout arrays!

    hello! what is the best way to clear an array so that i can fill it with new values?

  2. #2
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807
    what kind of arrays are we talking , Multidimensional, dynamic?

  3. #3
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    Why would you be clearing it? Just overwrite the present values.

  4. #4
    Registered User
    Join Date
    Feb 2003
    Posts
    76
    Code:
    memset(array,0,sizeof(array));

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>memset(array,0,sizeof(array));
    and one good reason not to do it that way would be this . (depending of course, on the contents of the array)
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 05-09-2009, 12:06 PM
  2. Very quick question about dynamic arrays.
    By Lawn Gnomusrex in forum C++ Programming
    Replies: 4
    Last Post: 11-13-2008, 03:22 PM
  3. Just a quick question about character arrays
    By Welshy in forum C Programming
    Replies: 3
    Last Post: 04-03-2006, 08:20 AM
  4. Do you know...
    By davejigsaw in forum C++ Programming
    Replies: 1
    Last Post: 05-10-2005, 11:33 AM
  5. A quick question on arrays.
    By Junon in forum C++ Programming
    Replies: 1
    Last Post: 09-02-2002, 04:11 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21