Using several files?

This is a discussion on Using several files? within the C++ Programming forums, part of the General Programming Boards category; When I have more than one source files do I need then declare all others files functions in main file ...

  1. #1
    Unregistered
    Guest

    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
    Unregistered
    Guest
    Code:
    #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
    Unregistered
    Guest
    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, 07:50 AM
  2. add source files to embedded VC 4.0
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 04:28 AM
  3. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 05: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, 11:46 AM
  5. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 02:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21