Predefining C Array

Posted by Johannes Jensen on Stack Overflow See other posts from Stack Overflow or by Johannes Jensen
Published on 2010-04-28T14:46:58Z Indexed on 2010/04/28 14:53 UTC
Read the original article Hit count: 290

Filed under:
|

In C, when defining an array I can do the following:

int arr[] = {5, 2, 9, 8};

And thus I defined it and filled it up, but how do I define it in my .h file, and then fill it in my .c?

Like do something like

int arr[];
arr = {5, 2, 9, 8};

I'm pretty new to C, not sure how it would look

any suggestions?

© Stack Overflow or respective owner

Related posts about c

    Related posts about arrays