FreePrograms

  CONTACT US   ABOUT US   PRIVACY  DISCLAIMER

C Language Tutorial with Free C Programs

FREE C PROGRAMS 

What is C C vs C++ vs Java Program Structure Data Types in C Basic Rules of C & C++
Functions in C If, Else Conditions Loops in C Switch Case Arrays
Pointers Structures in C Strings in C Command Line Arguments Type Casting
Linked Lists Recursion Binary Trees Inheritance Multiple Inheritance
Templates File I/O Object Oriented Programming Data Structures in C C interview Questions

Strings : - C Programming Tutorial

We use the header file #include <string.h> for strings.

Strlen()

length = strlen(ptr);
    where length is an integer &
    ptr is a pointer to char

Strcpy()

strcpy(ptr1, ptr2); string copy
    where ptr1 and ptr2 are pointers to char

Strcat()

strcat(ptr1, ptr2); used to concatenate

k= strcmp(ptr1, ptr2); used for string comparison
    where k is an integer

Sample String Programs

Count Number of Vowels, Characters and words in a paragraph

Use of Strlen( ) function

Use of Strcat( ) function

Use of Strcpy( ) function

Use of Strcmp( ) function

Use of Strrev( ) function

C program to sort a list of names

© COPYRIGHT 2009 ALL RIGHTS RESERVED FREECPROGRAMS.COM