C string functions 🔠

Veröffentlicht am: 06 Oktober 2021
auf dem Kanal: Bro Code
61,359
1.6k

C string functions tutorial example explained

#C #string #functions

int main(){

char string1[] = "Bro";
char string2[] = "Code";

strlwr(string1); // converts a string to lowercase
//strupr(string1); // converts a string to uppercase
//strcat(string1, string2); // appends string2 to end of string1
//strncat(string1, string2, 1); // appends n characters from string2 to string1
//strcpy(string1, string2); // copy string2 to string1
//strncpy(string1, string2, 2); // copy n characters of string2 to string1

//strset(string1, '?'); //sets all characters of a string to a given character
//strnset(string1, 'x', 1); //sets first n characters of a string to a given character
//strrev(string1); //reverses a string

//int result = strlen(string1); // returns string length as int
//int result = strcmp(string1, string2); // string compare all characters
//int result = strncmp(string1, string2, 1); // string compare n characters
//int result = strcmpi(string1, string1); // string compare all (ignore case)
//int result = strnicmp(string1, string1, 1); // string compare n characters (ignore case)

printf("%s", string1);

/*
if(result == 0)
{
printf("These strings are the same");
}
else
{
printf("These strings are not the same");
}
*/

return 0;
}


Auf dieser Seite können Sie das Online-Video C string functions 🔠 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Bro Code 06 Oktober 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 61,359 Mal angesehen und es wurde von 1.6 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!