Find the answer to your Linux question:
Results 1 to 8 of 8
hi, there. i want to learn to write in C, under linux ofcourse, but i just don't know where to start... can you, please, help me by posting links to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! hadgy's Avatar
    Join Date
    Oct 2004
    Posts
    11

    C


    hi, there.
    i want to learn to write in C, under linux ofcourse, but i just don't know where to start... can you, please, help me by posting links to some tutorials. i have a little experience with C under windows, but it's just not enough, i suppose...
    thx

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    this is a great guide, albeit a little short, but informative nonetheless:
    http://www.strath.ac.uk/IT/Docs/Ccourse/
    is there anything specific you want to do in C, cos I know of several specialized guides (i.e. curses, socket, kernel modules, etc)
    Also you can read up on built-in functions and libraries in section 3 of the manual pages!
    -lakerdonald

  3. #3
    Just Joined!
    Join Date
    Aug 2002
    Location
    New Jersey
    Posts
    28
    http://www.amazon.com/exec/obidos/tg...books&n=507846

    this was my first C book, it's an oldie but a goodie. I still think it's an excellent starting point for the language as well as a great reference for more experienced programmers.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User sheds's Avatar
    Join Date
    Nov 2004
    Location
    ??????????
    Posts
    342
    I am actually learning C under linux too. I learned C under Solaris at college, now i have mandrake and this is the way i am managing: i write the code in simple KWrite editor, which gives you colors, indentation and +'s and -'s for watching the code; i compile the .cc files with g++ file.cc -o resultfilename. So far it's working, maybe i will work for you too, to start learning.

  6. #5
    Linux User
    Join Date
    Jul 2004
    Posts
    256
    to compile c source:
    Code:
    $ gcc -o bin source.c
    to compile c++ source
    Code:
    $ g++ -o bin source.cpp
    --monkey

  7. #6
    Linux User sheds's Avatar
    Join Date
    Nov 2004
    Location
    ??????????
    Posts
    342
    Are .cc files compiled the same way?

  8. #7
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    Quote Originally Posted by sheds
    Are .cc files compiled the same way?
    Yes.
    .cc extension is conventionally used for C++ source code files.
    Read the manual page of gcc for all the suffixes(extensions) supported and their meanings.

    For compiling C++, you could also use:
    Code:
    $gcc -x c++ source.cc -o executable_name -lstdc++
    Obviously, this is quite tedious - especially when you have g++ to do the job for you :P
    The Unforgiven
    Registered Linux User #358564

  9. #8
    Linux User sheds's Avatar
    Join Date
    Nov 2004
    Location
    ??????????
    Posts
    342
    Right, so i'll just continue using g++. Either way, i'll read some more about creating libraries, got some issues here, but not gonna post them here.

Posting Permissions

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