array problem

Discussion in 'C Programming' started by voklta7, Oct 28, 2014.

  1. voklta7

    voklta7

    Joined:
    Oct 28, 2014
    Messages:
    1
    Likes Received:
    0
    The following piece of code is valid in c :

    Code (Text):
    #include <stdio.h>

    int main(int argc, const char * argv[])
    {
        int array1 = {1,2,3,4,5};
        int array2[] = {1,2,3,4,5};
        int array3[5] = {1,2,3,4,5};
    }
    I know array1 is a single int and array2 and array3 are actual arrays , but what is the use of statement

    Code (Text):
    int array1 = {1,2,3,4,5};

    why is it valid ? whats the use ?
     
    voklta7, Oct 28, 2014
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel
    Replies:
    1
    Views:
    1,233
    Kevin Collins
    Aug 14, 2003
  2. S300
    Replies:
    4
    Views:
    22,855
    Roedy Green
    Aug 19, 2003
  3. Mara Guida

    const and array of array (of array ...)

    Mara Guida, Sep 2, 2009, in forum: C Programming
    Replies:
    3
    Views:
    899
    David RF
    Sep 3, 2009
  4. Richard Lionheart
    Replies:
    27
    Views:
    790
    Jean-Hugues ROBERT
    May 4, 2004
  5. Cool Wong

    Array Problem, sort Array

    Cool Wong, Jun 28, 2007, in forum: Ruby
    Replies:
    17
    Views:
    504
    Peña, Botp
    Jun 30, 2007
  6. Tom
    Replies:
    3
    Views:
    463
    salsablr
    Dec 20, 2004
  7. Tuan  Bui
    Replies:
    14
    Views:
    857
    it_says_BALLS_on_your forehead
    Jul 29, 2005
  8. bintom
    Replies:
    11
    Views:
    905
    Luca Risolia
    Oct 15, 2012
Loading...