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?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Daniel
    Replies:
    1
    Views:
    1,269
    Kevin Collins
    Aug 14, 2003
  2. S300
    Replies:
    4
    Views:
    22,913
    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:
    925
    David RF
    Sep 3, 2009
  4. Richard Lionheart
    Replies:
    27
    Views:
    828
    Jean-Hugues ROBERT
    May 4, 2004
  5. Cool Wong

    Array Problem, sort Array

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