[Ilugc] [TIP] some C

  • From: girishvenkatachalam@xxxxxxxxx (Girish Venkatachalam)
  • Date: Thu, 22 Dec 2011 07:50:14 +0530

C programming is something everyone in India learns; at least whoever
has studied any of the core branches.

And many may not know how to compile and run a C program in a Linux box.

Here are some utter basics.

$ cat i.c
#include <stdio.h>
int
main() {
  printf("Hello World\n");
}

$ make i

or

$ gcc i.c

will get you the result.

The output file is either in i or a.out.

You can do a

$ ls -ltr

to figure out the latest file created.

Of course you should not compile C on UNIX without knowing some basic
UNIX commands.

A compiler like gcc only converts the source code of C into assembly.
You need a linker(ld) and an assember
 like gas to convert the assembly to machine code that is executed in the CPU.

Now C coding is about thinking a lot and not just getting your job
done without programming hassle.

In fact it is impossible to do C coding without design skills and no
high level design can be done without C coding
 experience.

In fact C is a language that demands an extremely high degree of
commitment, intellect and experience.

However most people seem to know many basic C programming concepts and
have experience running C code.

As to the IT industry I think any IT company in India depends on C
only as much as 20% or so.

Rest of the people get on with peripheral skills.

-Girish

-- 
G3 Tech
Networking appliance company
web: http://g3tech.in ?mail: girish at g3tech.in

Other related posts: