Thread: Why .c cannot be included

  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    347

    Why .c cannot be included

    I have this doubt why a .c file cannot be included any specific reason for that? There are no advantages with it?

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    3,744
    Quote Originally Posted by Satya View Post
    I have this doubt why a .c file cannot be included any specific reason for that? There are no advantages with it?
    I considered it a stylistic type rule.
    There is much better reasons to use goto than to include .c files.
    But, I have seen good code include .cpp files to work around compiler/OS support issues.

    I myself include .c files for testing purposes; but, I am testing non C standard code using an gcc compiler to display warning and errors that are NOT caught by the production C-like compiler.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    4,509
    There are generally no advantages, and several disadvantages. In most cases, it is a much better idea to use header files.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 8 Gl.h errors with included windows.h...
    By drewtoby in forum C++ Programming
    Replies: 6
    Last Post: 05-29-2011, 07:36 PM
  2. can someone help me with these errors please code included
    By geekrockergal in forum C Programming
    Replies: 7
    Last Post: 02-10-2009, 02:20 PM
  3. Nibbles (src included)
    By Perspective in forum Game Programming
    Replies: 7
    Last Post: 08-02-2004, 12:35 PM
  4. confuse about included files
    By C-Dumbie in forum C++ Programming
    Replies: 2
    Last Post: 12-31-2002, 07:04 PM
  5. Do you want gender to be included in our profiles?
    By joshdick in forum A Brief History of Cprogramming.com
    Replies: 32
    Last Post: 12-29-2002, 12:05 AM

Tags for this Thread