Introduction:
- C is a general-purpose high-level programming language
- developed by Dennis M. Ritchie at AT & T Bell Labs, USA in 1972
- initially, it was invented to develop UNIX Operating System
- C is the successor of BCPL(Basic combined programming language) also called B language
- in 1988 ANSI(American national standard institute) has formalized C language
- Linux OS, PHP, MySQL is written in c language
Uses of C:
C is used to developing System application eg:
- Database System
- Language Interpreters
- Compiler and assemblers
- Operating System
- Network drivers
- word processor(eg: WISIWIG editor(Bravo)=>What you see Is What you get)
Â
Data Types in C:
- used to identify the type of a variable when it declared
- int - 2 bytes (or maybe 4 bytes depending on the compiler configuration)
- float - 4 bytesÂ
- char - 1 byte
- long int or long - 4 bytes
- double - 8 bytes
Â
3. Functions:
Â
A function is a group of statements that together perform a task
A function is a set of statements that take inputs, do some specific computation and produces output.
4. pointers:: every variable is a memory location and every memory location has its address defined which can be accessed using ampersand (&) operator,
which denotes an address in memory
int *a; // a pointer to an integer
Â
1. strlen() => THE strlen() function calculates the length of a given string.
2. strcpy() => The strcpy() function copies the string to the another character array.
03.05.2017
3. strcmp() => //Done
4. strcat() => //DONEÂ
- The strcmp() function takes two strings and returns an integer.
- The strcmp() compares two strings character by character. If the first character of the two strings is equal, the next character of two
strings will be compared. This continues until the corresponding characters of two strings are different or a null character '\0' is reached.
- It is defined in string.h header file.