Thread: Using several files?

  1. #1

    Using several files?

    When I have more than one source files do I need then declare all others files functions in main file with extern. And I can`t understand how to use the class what is made in other file. Then extern dosn`t help anymore.

  2. #2
    #include "file.c"
    int main(void)
      //main function is only in this file
      //the other functions are in file.c
      //you can use them as if they were
      //in this source file though
      return 0;

  3. #3
    Thanks for answering but that was not what I mean.
    h fails and source fails are two different things.
    In you code there are h fail with name c.
    I mean another file what is compiling separatly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ressources files
    By mikahell in forum Windows Programming
    Replies: 4
    Last Post: 06-19-2006, 06:50 AM
  2. add source files to embedded VC 4.0
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 03:28 AM
  3. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 04:45 AM
  4. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 10:46 AM
  5. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 01:41 PM
Website Security Test