array problem

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

Code:
#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:
int array1 = {1,2,3,4,5};


why is it valid ? whats the use ?
 

Ask a Question

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top