Thread: how does typedef work in this question ???

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    17

    how does typedef work in this question ???

    Code:
    typedef int c[12];
    c name={1,2,3,4};
    cout<<name[0];
    how does the above code work ??

  2. #2
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    The 2nd line reads like:

    Code:
    int name[12] = {1,2,3,4};
    The rest of the places remain uninitialized.

    btw.... Though it doesn't matter here, you should post threads having C++ code in the C++ page.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-23-2011, 09:00 AM
  2. question about typedef
    By rob90 in forum C Programming
    Replies: 3
    Last Post: 12-14-2009, 06:01 AM
  3. Program on typedef - work around
    By thelink123 in forum C Programming
    Replies: 3
    Last Post: 07-24-2009, 03:56 AM
  4. Question regarding typedef
    By esmeco in forum C Programming
    Replies: 2
    Last Post: 04-24-2008, 11:58 AM
  5. typedef question
    By Chaplin27 in forum C++ Programming
    Replies: 4
    Last Post: 09-22-2006, 10:42 AM