Thread: Where is "STDIO.H" located?

  1. #1
    Beginning game programmer Petike's Avatar
    Join Date
    Jan 2008
    Posts
    64

    Where is "STDIO.H" located?

    Hi all,
    I would like to ask you, where the file "STDIO.H" is located (for example in my computer).
    Because I have recently searched for the file "stdio.h" in my computer and the only files I found were saved in the "Microsoft Visual Studio" directory but nothing in WINDOWS folder or like that.
    So if you could tell me, if there is on each computer after installing Windows (or another system) created the "STDIO.H" file, or if it is created after installing some "C/C++" program (like MS Visual Studio).

    And my second question would be, which program is best for programming in "C", for example "MS Visual Studio" or something else?

    Thanks.


    Petike.

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    53
    Although I have little experience with C, I can answer most of your questions.

    STDIO.H is a header file, which means that it's needed by compilers in order to find the functions you're using in your code, because let's face it, most of the functions we're using are code written by the creators of the language to make our life easier. So no, your computer doesn't have header files installed by default, it has libraries. Since your computer doesn't compile code by default, it runs precompiled binaries, which find all the libraries they need in DLLs, such as msvcrt*.dll for programs written in C.

    Header files come along with any C compiler, and any C IDE for that matter, that's why you found STDIO.H in Visual Studio's directories.

    The best program for programming in C is due to each user to decide. Although I've been using the Visual Studio suite to program in Visual Basic, I find it too bulky for my ANSI C assignments, for which I use some of the free C IDEs there are out there, such as C-Free and Dev-C++.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    25
    i ' not sure, but you have to search for an open source compiler, like Codeblocks.
    In my computer stdio.h is located at (something like)
    C:\Program Files\ CodeBlocks\include\stdio

    So here we are
    Code:
    # define EVERYTHINK 0
    int main ( void )
    { 
       while ( C_learning )
                 english_learning ( );
       return EVERYTHINK;
    }

  4. #4
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Header files are a development-only component. You will never find them unless a development environment, or at least a compiler, has been installed. So it's no big mystery why you are finding these files under your VS installation.

  5. #5
    Beginning game programmer Petike's Avatar
    Join Date
    Jan 2008
    Posts
    64

    One more question...

    ...thank you very much for your replies.
    One more question, is there only "ONE VERSION" of "STDIO.H" in the "world", or there are various stdio.h files with various data. For example, if I would like to download the STDIO.H file from the internet, would be all the basic "functions" included there?

    Petike.

  6. #6
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Header files contain implementation-specific details and macros; for instance, FILE, BUFSIZ, EOF may vary depending on what kind of machine you're on. A C compiler is obligated to provide stdio.h for you (unless you're compiling for a freestanding/embedded system), and that stdio.h will have appropriate values for where you are.

  7. #7
    Registered User
    Join Date
    Dec 2007
    Posts
    53
    The standard declarations and functions are common, however each header file differs depending on the platform and compiler.

    Check out the following two stdio's. The small one coming from MinGW, the bigger one from MSVC++ 2005.

  8. #8
    Registered User
    Join Date
    Dec 2007
    Posts
    25
    I suggest to download an opensource compiler and ( i belive, but not for sure ) you can modify the headers files
    for example you can change the value below
    Code:
    #define FOPEN_MAX	(20)
    FOPEN_MAX is the maximum number of files that could be open at the same time
    Last edited by fractal; 01-04-2008 at 04:02 PM.
    Code:
    # define EVERYTHINK 0
    int main ( void )
    { 
       while ( C_learning )
                 english_learning ( );
       return EVERYTHINK;
    }

  9. #9
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Petike View Post
    ...thank you very much for your replies.
    One more question, is there only "ONE VERSION" of "STDIO.H" in the "world", or there are various stdio.h files with various data. For example, if I would like to download the STDIO.H file from the internet, would be all the basic "functions" included there?
    No functions exist inside header files. They are useless without the libraries they are associated with.

    Header files don't give you anything. You have to #include them in order to compile, that's all.

  10. #10
    Registered User
    Join Date
    Dec 2007
    Posts
    25
    Quote Originally Posted by brewbuck View Post
    No functions exist inside header files. They are useless without the libraries they are associated with.

    Header files don't give you anything. You have to #include them in order to compile, that's all.
    And my question is, where can i find funcions. For example, i like to study the "printf" function. Is this not available in a opensource compiler?
    Code:
    # define EVERYTHINK 0
    int main ( void )
    { 
       while ( C_learning )
                 english_learning ( );
       return EVERYTHINK;
    }

  11. #11
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > Is this not available in a opensource compiler?
    It's not part of the compiler, it's part of the standard C library.
    Look for "glibc source code"
    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.

  12. #12
    Registered User
    Join Date
    Dec 2007
    Posts
    25
    Quote Originally Posted by Salem View Post
    > Is this not available in a opensource compiler?
    It's not part of the compiler, it's part of the standard C library.
    Look for "glibc source code"
    in google?
    believe me i will look at!!!!
    Code:
    # define EVERYTHINK 0
    int main ( void )
    { 
       while ( C_learning )
                 english_learning ( );
       return EVERYTHINK;
    }

  13. #13
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by fractal View Post
    And my question is, where can i find funcions. For example, i like to study the "printf" function. Is this not available in a opensource compiler?
    If you're using Visual Studio, the source code is in the crt\src sub-directory. Here's the default location for VC++ 2005:
    C:\Program Files\Microsoft Visual Studio 8\VC\crt\src

  14. #14
    Registered User
    Join Date
    Dec 2007
    Posts
    25
    Quote Originally Posted by cpjust View Post
    If you're using Visual Studio, the source code is in the crt\src sub-directory. Here's the default location for VC++ 2005:
    C:\Program Files\Microsoft Visual Studio 8\VC\crt\src
    is that .c files so i can read them?
    Code:
    # define EVERYTHINK 0
    int main ( void )
    { 
       while ( C_learning )
                 english_learning ( );
       return EVERYTHINK;
    }

  15. #15
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Most are .c or .cpp files. Some functions are .asm though.
    The easiest way is to take a look for yourself.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 02-19-2009, 09:37 AM
  2. Returning from function located in object file
    By lord_didger in forum C Programming
    Replies: 3
    Last Post: 01-24-2006, 06:18 AM
  3. Replies: 4
    Last Post: 12-19-2005, 03:01 PM
  4. where is pow() located?
    By thinhare in forum C Programming
    Replies: 7
    Last Post: 01-10-2005, 04:42 PM
  5. Replies: 2
    Last Post: 06-18-2002, 10:13 AM