Functions in a separate file

This is a discussion on Functions in a separate file within the C Programming forums, part of the General Programming Boards category; Alrighty, for my next class project, my prof wants me to use separate files to make the program. The constants, ...

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    37

    Functions in a separate file

    Alrighty, for my next class project, my prof wants me to use separate files to make the program. The constants, #includes and prototypes must be in one file while the main function and any others functions are in another. Using XCode on a mac, how would I go about doing this and how do I connect the files to the main file? I assume thats what I am trying to do.
    Last edited by Fox101; 01-29-2008 at 01:37 PM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    http://faq.cprogramming.com/cgi-bin/...&id=1043284392
    That's for C++, but some of the ideas apply to C as well.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  2. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  3. Help on simple file functions
    By enjoyincubus in forum C Programming
    Replies: 20
    Last Post: 12-01-2006, 03:41 AM
  4. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM

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