Content:-
- History,standards,GNU tools
- Language Basics,Operators
- Control Structures- Decision-making statements, Loops
- Pointers and Arrays
- Functions
- Strings
- Structures and Unions
- Dynamic Memory
- Data Structures-Stacks,Queues,Linked List,Trees,Searching and Sorting
The reader is urged to strictly use
GCC( GNU C Compiler) for development .
- On a Linux machine, Press Ctrl+Alt+T.
- The terminal will open.
- You can use any of the popular editors like Vi,ViM,emacs,nano, etc.
Let us assume that we are using the Vi
editor. To start with a basic C program, follow the below mentioned
steps after you have launched the terminal:-
- vi hello_world.c
- Press 'i' key. (--INSERT status will be displayed)
- Now you can type your program here
- When you are done with your code, press ESC key to come out of input mode.
- Now press “ :wq “. This will save your program and exit from the editor.
- Now you are back to the terminal again.
- Compile the code as :-
- gcc hello_world.c -o hello_world.out
- hello_world.out is the executable binary file generated as a result of compilation
- To execute the binary:-
- ./hello_world.out
<< If you don't pass any outfile
parameter, and just compile the code as:-
gcc hello_world.c
The binary executable file gets
generated with the name a.out.
You then have to execute it as usual :-
./a.out
>>
<<Linux
Shell has a special feature of sentence autocompletion. To leverage
it, type partial command and press the TAB key. The entire command
will be autocompleted.>>
All the above mentioned steps for
writing and compiling a simple C program have been depicted through
the following snapshots:-
For more information on GCC, type the following on the terminal :-
man gcc
The whole world of GCC is before you now.
Explore as much as possible.




That's very key thing for beginner..Nicely express
ReplyDeleteThanks. Hope to meet up the same expectations with advanced topics too !!
Delete