Thread: How do I add .C Project to my complier?

  1. #31
    Registered User
    Join Date
    Apr 2006
    Posts
    65
    Quote Originally Posted by Trafalgar Law View Post
    you forgot the
    Code:
    }
    again


    Lol. Now, it worked. It took a lot. I do have The C Programming book here. It didn't say int or anything.

  2. #32
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Remake your whole project, php. I think your files got all screwed up, so you tried to fix it by adding the correct file... and so on and so forth. Now your project is just a mess.

  3. #33
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    This may be a record, 30 posts just to get "Hello world."

    I'm not saying it's a record we like, but I guess we'll take what we can get.

  4. #34
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Eh? Didn't your posted code have the brace? Go figure. I still don't understand why it is trying to compile a header file during compilation.

  5. #35
    Registered User
    Join Date
    Apr 2006
    Posts
    65
    Quote Originally Posted by master5001 View Post
    Remake your whole project, php. I think your files got all screwed up, so you tried to fix it by adding the correct file... and so on and so forth. Now your project is just a mess.
    Screw it for right now. I am having a chew.

  6. #36
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by php111 View Post
    Lol. Now, it worked. It took a lot. I do have The C Programming book here. It didn't say int or anything.
    Really?
    I find it difficult to believe that any book would not teach you how to write main, or how to write any function, for that matter.
    A function always begins with a
    Code:
    {
    and always ends with a
    Code:
    }
    . And a function must always return something. And if you don't actually intend to return anything, it should return void.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #37
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Haha. I remember when I was first learning assembler. My hello world app made my system black screen (which if you are a rookie programmer, that is what happens when your computer does something so wrong that it can't even fathom a blue screen).

  8. #38
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Furthermore he said he is looking at K&R, right? Don't make me crack open my copy and take a picture to show you that you are wrong. There is no need for us to humiliate eachother at this point.

  9. #39
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Well OK, if the book fails to describe how a function looks like, then it's a bad books that should be burned.
    Fair enough, yes?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #40
    Registered User
    Join Date
    Apr 2006
    Posts
    65
    First sticky at the top of the forum, first reply.


    The C Programming Language by Brian W. Kernighan and Dennis M. Ritchie.

    Good for: Learning the C Programming Language.

    Not good for: Learning to program a VCR, learning general programming concepts.. Possibly not ideal if you've never done any programming before, but Your Mileage May Vary.

  11. #41
    Registered User
    Join Date
    Apr 2006
    Posts
    65
    I really need another book. I keep getting the same errors. The C Programming Language is NO good.

    1>------ Build started: Project: C Programming File.c, Configuration: Debug Win32 ------
    1>Compiling...
    1>C Programming File.c.cpp
    1>c:\documents and settings\baseball\my documents\visual studio 2008\projects\c programming file.c\c programming file.c\C Programming File.c.h(3) : error C2144: syntax error : 'int' should be preceded by ';'
    1>c:\documents and settings\baseball\my documents\visual studio 2008\projects\c programming file.c\c programming file.c\C Programming File.c.h(3) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>Build log was saved at "file://c:\Documents and Settings\baseball\My Documents\Visual Studio 2008\Projects\C Programming File.c\C Programming File.c\Debug\BuildLog.htm"
    1>C Programming File.c - 2 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Code:
    #include <stdio.h>
    library
    int main()
    {
    	printf("hello, world!\n");
    }

  12. #42
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    I don't have a copy of K&R, but I am willing to bet any amount you name that the word "library" never appears in a source code example like that.

  13. #43
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I have no idea what that "library" word is supposed to do.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  14. #44
    Registered User
    Join Date
    Apr 2006
    Posts
    65
    Code:
    #include <stdio.h> include information about standard
    library
    main() define a function called main
    that received no argument values
    { statements of main are enclosed in braces
    printf("hello, world\n"); main calls library function printf
    to print this sequence of characters
    } \n represents the newline character

    From the book.

  15. #45
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Nowhere does it say you should type "library" anywhere.
    All it says is that you include information about the standard library by including <stdio.h>.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem about making setup project
    By sgh in forum Windows Programming
    Replies: 0
    Last Post: 04-30-2008, 03:09 AM
  2. Add a VS 2K8 express template for .c
    By vtechv in forum C Programming
    Replies: 2
    Last Post: 02-11-2008, 03:13 AM
  3. How to add a file to a project in bloodshed.
    By Smeep in forum C++ Programming
    Replies: 4
    Last Post: 04-22-2005, 09:29 PM
  4. Project details: Dedicated
    By Stack Overflow in forum Projects and Job Recruitment
    Replies: 9
    Last Post: 02-22-2005, 03:10 PM
  5. Can somebody test this code please
    By andy bee in forum C Programming
    Replies: 6
    Last Post: 10-09-2001, 03:08 PM