Re: How include a large array?

Discussion in 'C Programming' started by Joe Pfeiffer, Apr 3, 2013.

  1. Joe Pfeiffer

    Joe Pfeiffer Guest

    writes:

    > Hi,
    > i have this problem: i want to create a large array data that can be portable and so included in multiple files. I thought about an "array.c" file that can be included in test file with an include like this:
    > #include "array.c"
    > The compiler gives me an error:why?
    > I thought about an "array.h" file, but i can't put an instance (in this case the data array) in an header file...or not?
    > How can i do?
    > Thanks


    Both possible approaches you mention should work. Without any idea of
    what your array.c file contains, what code you've got around it in the
    file that includes it, or what the compiler error is, it's really
    impossible to guess what's going wrong.
    Joe Pfeiffer, Apr 3, 2013
    #1
    1. Advertising

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. Andreas Bogenberger
    Replies:
    3
    Views:
    886
    Andreas Bogenberger
    Feb 22, 2008
  2. Ketchup
    Replies:
    1
    Views:
    233
    Jan Tielens
    May 25, 2004
  3. Siri Cruise

    Re: How include a large array?

    Siri Cruise, Apr 3, 2013, in forum: C Programming
    Replies:
    0
    Views:
    219
    Siri Cruise
    Apr 3, 2013
  4. James Kuyper

    Re: How include a large array?

    James Kuyper, Apr 3, 2013, in forum: C Programming
    Replies:
    0
    Views:
    259
    James Kuyper
    Apr 3, 2013
  5. Eric Sosman

    Re: How include a large array?

    Eric Sosman, Apr 3, 2013, in forum: C Programming
    Replies:
    0
    Views:
    204
    Eric Sosman
    Apr 3, 2013
Loading...

Share This Page