C programming for Linux 4

In C text data type is called string. Basically it is an array of char with 0 value as the delimiter. we use the \0 char for the zero value at the end of string. so if we have text with 11 charters, we will need char array with the size of 12 to include … Continue reading C programming for Linux 4


c programming for Linux 3 -data type

In C if we want to work with rational numbers that include floating point then we have the data type float, if we want double precision then can use double. In order to print floating number we use %f inside the printf. For example (program between ======) start.c ================================ #include int main(int argc, char *argv[]){ … Continue reading c programming for Linux 3 -data type

c programming for Linux 2 – data type

In c variable has data type, that define the type of data they contain. C data type are very similar to java primitive. For integer number we are using the data type int. int is 4 byte in size and contain only whole number. Let see an example: #include int main(int argc, char *argv[]){ int … Continue reading c programming for Linux 2 – data type

c programming for Linux

We will start with hello world in C and explain the structure of the program #include <stdio.h> int main(int argc, char *argv[]){ printf("Hello world\n"); return 0; } Now lets explain the code line by line. The first line is #include and it will load the standard input and output library. The second line is the … Continue reading c programming for Linux