Sunday, 1 May 2016

File handling to import and export huge data using Comma separated values


While writing a c program we all deals with the bulk data which may be available on spread sheets like Excel but we can't directly read into the program but we can read a single sheet a workbook with the help of csv format. To do so we have to save the file in csv format from excel. Then read that file in c program using file handling.
The csv file separate the data by commas
but if we have the commas in the data then the field will be enclosed in the double quotes
like "1,2" .
Again we may also require the double quotes also in the file so it can also be written as
"1,2"" this will generate the output as  1,2"
Hope u got the basic concept of a csv file
Rest is the basic file handling

Sunday, 27 March 2016

Tokens in C language

Definition 1: The Tokens are the basic building blocks any programming language. They are the smallest unit of the programming language that cannot be further broken.
There are 6 types of tokens in the C language.
1.       Identifiers
2.       Keywords
3.       Constants
4.       Variables
5.       Operators
6.   Punctuations


Example of the tokens in the C program
void main()
{
printf(“welcome”);
}

In the above example
  •  void is keyword
  •  main is the function name  an identifier.
  • printf() is again a function name