Definition | #include <string.h> char *strupper(char *s1, const char *s2);
If string s2 is passed as a NULL pointer, the copy operation is not performed and the lowercase letters in s1 are converted to uppercase. |
Return val. Notes | Pointer to the result string s1. Strings terminated with the null byte (\0) are expected as arguments.
The behavior is undefined if memory areas overlap. |
Example | The following program copies the contents of s2 to s1, converting lowercase letters to uppercase in the process. #include <stdio.h> #include <string.h> int main(void) { char *s1 = " "; char *s2 = "lowercase!"; printf("Contents s2: %s\n", s2); /* Copy s2 to s1 and convert to uppercase*/ strupper(s1, s2); printf("After strupper:\ncontents s1: %s\n", s1); return 0; } |
See also | strlower, tolower, toupper |