[Ilugc] Learning C coding

  • From: smal at ccmb.res.in (smal@xxxxxxxxxxx)
  • Date: Tue, 26 Jun 2012 18:09:31 +0530 (IST)



----- Original Message -----
From: "Girish Venkatachalam" <girishvenkatachalam@xxxxxxxxx>
To: "Indian Linux User Group Chennai" <ilugc at ae.iitm.ac.in>
Sent: Tuesday, June 26, 2012 3:48:08 PM
Subject: [Ilugc] Learning C coding

All my life I have benefited by C coding skills.

I first learnt C when I was in college but I did not learn properly.

I was not from computer science department and I was not a good student
 in certain ways.

In many other ways I was a good student.

Anyway C programming is something I started to focus much later.

Today I realize that without that I would not have been able to make a living.

How to start learning C?

How long does it take?

C coding requires knowledge of pointers, structures, callback
functions and so on.

Some concepts take time to learn as they are new concepts.

Not really programming.

However analytical ability , mathematical thinking which is
fundamental to programming
 apply to C too.

You have to know how systems programs are written.

And some style guidelines are also good to follow.

Like indenting loops and if conditions, forming comment boxes like this:

/***********************************
 *
 ***********************************/

It is very important to learn the
system() system call since it does a fork() and exec() to execute
shell programs.

For example.

$ cat f.c
#include <stdio.h>
int
main() {
   system("date");
}

$ make f

$ ./f

will print the date.

It is a great idea though it is slow and you should actually be using
strftime(), gettimeofday() or time() or some
 such thing.

But sometimes using system() is allowed.

Also you can learn some IPC mechanisms like shmget(), shmat() and signals.

And of course sockets programming.

I will write about those later.

Then it took me some good 6 more years to become comfortable.

Even today I would not claim to be a very good c programmer.

It also requires memory power as is the case with UNIX and perl in general.

-Girish

-- 
Gayatri Hitech
http://gayatri-hitech.com


Thanks a lot. keep it up.

s.mahalingam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smal.vcf
Type: text/x-vcard
Size: 170 bytes
Desc: not available
Url : 
http://www.ae.iitm.ac.in/pipermail/ilugc/attachments/20120626/424deae4/attachment.vcf
 

Other related posts: