Strchr

Nasza ocena:

3
Wyświetleń: 2303
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Strchr - strona 1 Strchr - strona 2

Fragment notatki:

Strchr  char *strchr(const char *s, int c);  Scans a string for the first occurence of a given character  The null-terminator is considered to be part of the string  If c does not occur in s, returns NULL #include #include int main() { char string[20]; char *ptr, c = 'r'; strcpy(string, "This is a string"); ptr = strchr(string, c); if (ptr) printf("The character %c is at position: %d\n", c, ptr-string); else printf("The character was not found\n"); return 0; } /* Result: The character r is at position: 12 */ ... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz