Thread: Doubt in c

  1. #1
    Registered User
    Join Date
    Jan 2007

    Question Doubt in c

    anyone can help me, how to include a "C" file which already contains main() function to another one.

  2. #2
    Registered User
    Join Date
    Jan 2007

    Thumbs down not possible

    hi ,,,

    i think according to me it is not possible since there will be a conflict between the main functions

    wish u get an answer for this question

  3. #3
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Rishon LeZion, Israel
    there is no need to "include" C-file into another one, in the first place
    it can be done, but there is no need to do it in 99% of the cases
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    David J. Wheeler

  4. #4
    Registered User
    Join Date
    Apr 2006
    Make a project. Use preprocessor conditionals to mark which main block to use. Do not #include 1 .c file in another.
    The preprocessor directives you want are #if, #endif, and #ifdef. There are others you can use too.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  5. #5
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Cambridge, UK
    You can call other C code from your code. Read FAQ about that.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Doubt in pointer.
    By shwetha_siddu in forum C Programming
    Replies: 5
    Last Post: 03-21-2009, 01:28 AM
  2. Replies: 4
    Last Post: 12-10-2006, 07:08 PM
  3. Doubt abt Storage!
    By kalamram in forum C Programming
    Replies: 1
    Last Post: 04-21-2006, 05:30 AM
  4. arrays doubt
    By j0nnyX in forum C Programming
    Replies: 4
    Last Post: 11-20-2004, 01:10 PM
  5. Greatest C++ Doubt
    By vasanth in forum C++ Programming
    Replies: 15
    Last Post: 02-28-2002, 04:41 AM