Strlen
Sprawdza długość łańcucha str.
Zlicza ilość znaków wchodzących w skład ciągu, nie wliczając znaku null.
Parametry:
- str
- Łańcuch znaków.
Zwraca długość łańcucha str.
Przykład
#include <stdio.h>
#include <string.h>
int main()
{
unsigned len = strlen("tekst");
printf("%u\n", len);// program wyświetli: 5
len = strlen("\0tekst");
printf("%u\n", len);// program wyświetli: 0
return 0;
}
#include <string.h>
int main()
{
unsigned len = strlen("tekst");
printf("%u\n", len);// program wyświetli: 5
len = strlen("\0tekst");
printf("%u\n", len);// program wyświetli: 0
return 0;
}
Wersja Unicode:
Zobacz też:
Coldpeer dnia 11-07-2006 00:32
@adf88: że tak spytam, po co pozamieniałeś te wszystkie kody z C++ na C?
Coldpeer dnia 18-04-2006 10:00
To dopisz 

Valarius dnia 17-04-2006 22:43
Jeszcze powinienes dopisac, ze zlicza do magicznego znaku '\0'


