How to learn c programming in easiest way

Jul 21, 2012, by admin

learn-c-programmingC is a influential programing language that was first developed in the 1970’s. Depending on your previous programming experience, it may take time and patience to learn C. However, once learned, learning other programming languages will come naturally. While learning the entire language is beyond the scope of this article, it will get you started in the right direction.

c-programming-languageSteps to learn c programming in easy way  

c-programming-logo1.First find a compiler that is compatible with your operating system, and decide whether you want to run an Integrated Development Environment (IDE) or if you want to edit C files manually through an editor like Notepad and compile from the command line.

  • If you’re a Windows user, try using Visual C++ Express Edition which is available for download for free.
  • If you’re a Mac user, you can use Xcode, available from the Leopard install disk or the Apple Developer Program.
  • If you’re a GNU/Linux user, try KDevelop or Eclipse. Eclipse is also available for Windows.
  • Alternatively, you can use the command line tools (GCC runs under any Unix and it is possible to run it under Windows and Mac).
  • Tiny C Compiler (TCC) is great if you don’t want to get a ton of bells and whistles that come with other compilers

2.Learn how to compile and run a basic program, this will be your first program, typically it will just print “Hello World” to the screen and exit. Don’t worry about all the minor details of the syntax, just become comfortable with compiling and running.

3.Learn about variable types, such as the difference between char, int, float, double, etc.

4.Learn about the concept of variables, arrays and functions. Variables are where information is stored, functions are pieces of code that can be executed and arrays are groups of data of the same type.

5.Learn pointers. Pointers are very important in C since you can directly access memory contents through pointers, unlike Java. The drawback to this is that if your program isn’t thoroughly tested, it can crash.

6.Learn conditional statements, such as the “if” and “switch” statements. The “if” statement will be one of your most frequently used statements, you can carry out code based on whether a condition is true or not (e.g. whether the color the user provided was red).

7.Learn loops. Learn the difference of the “for” loop and the “while” loop – make sure to avoid infinite loops! Learn the continue and break statements.

8.Learn data structures. Although data structures are not directly related to programming, but for an advanced user, knowledge of basic concepts in Computer Science is essential.

9.Start with small programs. When you are making your own code, try to recognize the most necessary part of the problem – is it the data input or the calling of the functions, the structure of the loop (these are some very elementary examples) and start from there. Then build upon that in small increments.

10.Learn key steps about debugging. Although it looks little complicated in the beginning, but if you have a large source code, then using print statements gets little overwhelming.

11.Enroll yourself in some of the mailing lists online. You can post your own of questions and support other new users.

12.Remember, the key to learning anything new is perseverance & hard work.