Find the answer to your Linux question:
Results 1 to 9 of 9
Hello everyone, I love (learning) programming and I chose C as my first try. I am right in the middle and I can write programs to a level that programmers ...
  1. #1
    Linux User
    Join Date
    Jun 2007
    Posts
    458

    Best Way to Learn C

    Hello everyone,

    I love (learning) programming and I chose C as my first try. I am right in the middle and I can write programs to a level that programmers won't laugh at.

    Now I have a book. When I switch on this machine in order to write new programs, open Gedit, my mind halts. I just shut it away. Any suggestions how you should learn C and don't waste any electricity?

    Difficult question of course, you think while you computer is doing its best to increase global temperature. Perhaps I should go to my old way of writing code in a notebook and try it later when "I'm in a mood to!"
    "When you have nothing to say, say nothing."

  2. #2
    Linux Newbie bobescalin2005's Avatar
    Join Date
    Oct 2005
    Posts
    167
    Hi! That`s a good question. I am trying to do the same thing. You can try eclipse for c/c++ as IDE and "C for Dummies" as book. But i don`t get it one thing: why C and not C++ or C# for example to make drivers for linux and other powerfull applications? It`s C more powerfull then C++ or C#?

    Cheers!
    Registered Linux user #471256
    http://counter.li.org
    Don`t give up so easy...
    calin

  3. #3
    Linux User
    Join Date
    Jun 2007
    Posts
    458
    Eclipse is rubbish on my PC. Some sceptics here have suggested that it spoonfeeds you and you don't know what happened. And it is slower than a snail. GCC is the best. The book I have is "LPE Programming in C" by Stephen G. Kochan. C is not an OOP itself but the base of all languages containing the alphabet C and of Java. All its derivatives are OOPs. UNIX is written in C (modern Macs are also UNIXes). Once you know C, C++ is nothing. just a little difference of header names and function names.
    "When you have nothing to say, say nothing."

  4. #4
    Linux User
    Join Date
    Jun 2007
    Posts
    458
    I forgot the other part of your question. C is not powerful but the GTK is written in C. (GNOME XFCE and stuff). Linux kernel is C++ but these two languages can even be compiled by a single compiler. As I said, little difference in code.
    "When you have nothing to say, say nothing."

  5. #5
    Linux Guru bryansmith's Avatar
    Join Date
    Nov 2004
    Location
    /Ontario/Canada
    Posts
    2,621
    When I decided to stick to one language as opposed to jumping from one to another (like I do distros), I bought a good book. Doing some research ahead of time is the key.

    Learning is the best when you are excited about it. Come up with a project idea that is not out of your league but will help you learn. If you are excited about the project, you will likely work on it more.

    Bryan
    Looking for a distro? Look here.
    "There can be no doubt that all our knowledge begins with experience." - Immanuel Kant (Critique of Pure Reason)
    Queen's University - Arts and Science 2008 (Sociology)
    Registered Linux User #386147.

  6. #6
    Just Joined! geniuz's Avatar
    Join Date
    Mar 2008
    Location
    Netherlands, Europe
    Posts
    71
    If you ask me, C is tough language, it's one of the oldest around...the best advice I can give you if you want to learn C without really having any programming knowledge is to start of with a somewhat easier language like perl. I and a friend decided to try code a graphical calculator in C, we came a long way, yet we had about 1000 lines of code and didn't even started with the GUI yet. It's kinda complicated, after we've written some scripts in perl, which is a lot easier, we found C a lot easier to pick up.

  7. #7
    Linux User
    Join Date
    Jun 2007
    Posts
    458
    Its sure the oldest one. But I find the code 'beautiful'. Once I begin a language, I am used to its code then its nothing difficult.

    bryansmith is right on the point that you should start a more difficult project. I learnt arrays and was able to build a program to calculate the mean. Long code and for loops. But enjoyable. My question is, how to make yourself SIT and learn the language. Don't internet, music, stuff tempt you?
    "When you have nothing to say, say nothing."

  8. #8
    Just Joined! geniuz's Avatar
    Join Date
    Mar 2008
    Location
    Netherlands, Europe
    Posts
    71
    Oh in that case...you should indeed think of some kind of project you believe you can make, you should see it as a challenge for yourself. If you're really interested in programming you should find that very fun and once you've finally completed you should feel proud, even it's very simple...

    This way you can raise standards and explore more and more fields in a programming language until you've mastered it.

    I for example decided to code a graphical calculator in C, it never finished, but I came a loooong way conquering a lot of obstacles. I was almost addicted and determined to finish it. I only found that making a GUI in C including the plot part of the program was far to hard to do by two guys. Nevertheless when we started in perl, we finished it in a couple of days cause of the knowledge we had in C.

  9. #9
    Just Joined!
    Join Date
    Jun 2008
    Posts
    4
    google for tutorials, use pscode.com to more specific source code and tutorials and analyze them

Posting Permissions

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