MCS-011 Problem Solving and Programming

First year, Semester 1

Chapters

Newsletter

Other String functions

Some other string functions are:

  1. strncpy function: Copies characters from one string to another up to a specified length.
    Syntax: strncpy(str1, str2, 10);
  2. stricmp function: Compares two strings ignoring case differences.
    Syntax: n = stricmp(str1, str2);
  3. strncmp function: Compares two strings up to a specified length.
    Syntax: n = strncmp(str1, str2, 10);
  4. strchr function: Returns the address of the first occurrence of a specified character in a string.
    Syntax: cp = strchr(str, c);
  5. strset function: Replaces all characters in a string with a specified character.
    Syntax: strset(first, ch);
  6. strncat function: Appends up to a specified length of one string to another.
    Syntax: strncat(str1, str2, 10);
  7. strupr function: Converts lower case characters of a string to upper case.
    Syntax: strupr(str1);
  8. strstr function: Returns the address from where the second string starts in the first string.
    Syntax: cp = strstr(first, second);

Report an issue

Reporting: Other String functions (topic)

Related Posts