May 2012
Intermediate to advanced
679 pages
16h 56m
English
In this section, we have used many functions working on string. Few important functions are given in Table 8.1 for ready reference.
Table 8.1 Useful String functions
| Function | Description |
|---|---|
| strlen(s1) | Returns the length of the string |
| strcpy(s1,s2) | Copies s2 in s1 |
| strcmp(s1,s2) | Compare s1 and s2 alphabetic/dictionary wise |
| stricmp(s1,s2) | Same as strcmp(), ignores case |
| strset(s1,ch) | Sets all characters of s1 to ch |
| strlwr(s1) | Converts all the alphabets in s1 to lowercase |
| strupr(s1) | Converts all the alphabets in s1 to uppercase |
C++ is a superset of C. Whatever we have discussed about strings so far, is also valid in C. Therefore some texts call these strings as C-strings. Latest C++ ...
Read now
Unlock full access