Thread: help with array

  1. #1
    Unregistered
    Guest

    Question help with array

    Hi everyone,
    I've just started studying arrays and have a question.
    Is there a way to initialize all of the elemts of an array to 0 at the same time.
    And does anyone know a good place to start reading on arrays on the web?
    thanks

  2. #2
    Registered User stormbringer's Avatar
    Join Date
    Jul 2002
    Posts
    90
    int array[ELEM]

    Code:
    for(i = 0 ; i < ELEM ; i++)
        array[i] = 0;
    for tutorials

    www.google.com
    www.altavista.com
    www.yahoo.com
    ....

    stormbringer

  3. #3
    Unregistered
    Guest
    so there is no way to do it without loop?

  4. #4
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    int iArray[20] = {};

  5. #5
    Banned borko_b's Avatar
    Join Date
    Jun 2002
    Location
    Well... I live in Bulgaria :)
    Posts
    100
    char *arrayOfStrings[256] =
    {
    "String number 1",
    "String number 2",
    "String number 3",
    "String number 4",
    "String number 5",
    "String number 6"
    };

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 05-29-2009, 07:25 PM
  2. Replies: 6
    Last Post: 11-09-2006, 03:28 AM
  3. [question]Analyzing data in a two-dimensional array
    By burbose in forum C Programming
    Replies: 2
    Last Post: 06-13-2005, 07:31 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM