c/c++

This is a discussion on c/c++ within the C Programming forums, part of the General Programming Boards category; Hi, Any one can help me find out, why I got the error on this program please. attached my source ...

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    1

    Post c/c++

    Hi,

    Any one can help me find out, why I got the error on this program please.
    attached my source code.
    Attached Files Attached Files
    Last edited by thdinh; 04-02-2003 at 03:48 AM.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    13
    #include "stack.h"
    #include "fileio.c"
    #include "stack.c"
    #include "string.c"

    are these files standard?? i dont seem to have them.

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    What error? Be a bit more specific...
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    102
    Originally posted by GhOsT_DeStRoYeR
    #include "stack.h"
    #include "fileio.c"
    #include "stack.c"
    #include "string.c"

    are these files standard?? i dont seem to have them.
    They the stack.h string.h and fileio.h are standard headders.
    Including .c files usualy makes compiers not very happy.
    Why are you including the .c files any ways..

    And the #include "" will include a non-standard headder
    I would relace the #include ""'s with
    #include <stack.h>
    #include <fileio.h>
    #include <string.h>

    HTH

  5. #5
    Open to suggestions Brighteyes's Avatar
    Join Date
    Mar 2003
    Posts
    204
    They the stack.h string.h and fileio.h are standard headders.
    Maybe the Posix standard, but certainly not the C standard. The C standard library only uses string.h from that list.
    Including .c files usualy makes compiers not very happy.
    Yea, including source files is a bad idea. Linking isn't done with the preprocessor.

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    102
    I though that fileio was standard for C++. But then I dont code in C++ so Im not farmilar with the C++ standard libs. The title of the thread is why I looked included the fileio.h

    Thanks

Popular pages Recent additions subscribe to a feed

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