Results 1 to 6 of 6

Thread: Newbie trying to get C code to work...

  1. #1
    Join Date
    Mar 2011
    Beans
    49

    Smile Newbie trying to get C code to work...

    I'm using Ubunty 12.4 and my attempts to get 'Hello World' to work have failed !

    I need some help here (I'm try to lean C) so geting anything to 2ork would be great !

    Any examples or tutorials would be great !

    Any thought anyone ?



    Tim

  2. #2
    Join Date
    Aug 2011
    Location
    52° N 6° E
    Beans
    2,773
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Newbie trying to get C code to work...

    Code:
    $ cat hello.c
    #include <stdio.h>
    
    int main()
    {
        printf("Hello world!\n");
        return 0;
    }
    $ gcc -o hello hello.c
    $ ./hello
    Hello world!
    What exactly doesn't work? Writing the code, running the compiler or running the code? Do you use any IDE? I think google can point you to plenty of tutorials.

  3. #3
    Join Date
    Mar 2011
    Beans
    49

    Re: Newbie trying to get C code to work...

    Ah ! It worked ! I think it was simple finger problems such as missing out the word hello ! *LOL*

    Many many thanks !

    I think an idiots guide to C from Amazon is the next step.

    Many many thanks as I was panicking !

    I found this that seems very good !


    http://phoxis.org/2009/12/01/beginners-guide-to-gcc/




    Tim
    Last edited by Timmoore001; August 30th, 2013 at 01:19 PM.

  4. #4
    Join Date
    Aug 2011
    Beans
    1

    Re: Newbie trying to get C code to work...

    Here, you could try this tutorial: http://c.learncodethehardway.org/

  5. #5
    Join Date
    Mar 2011
    Beans
    49

    Re: Newbie trying to get C code to work...

    Quote Originally Posted by add7 View Post
    Here, you could try this tutorial: http://c.learncodethehardway.org/
    Err.. looks like a 29 US$ bill for checking it out. Have I got that right ? Think I'll spend less on a book.

    Many thanks for the suggestion tho...

    Tim

  6. #6
    Join Date
    Mar 2011
    Beans
    49

    Smile Re: Newbie trying to get C code to work...

    I found this which is very interesting from a historical point of view !

    http://www.lysator.liu.se/c/bwk-tutor.html

    Does not better than that ! *LOL*





    Tim

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •