Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int nstrlen(char *str, int res);
- int main()
- {
- char str[10];
- printf("Entrez votre nom : ");
- scanf("%s", str);
- printf("%d", nstrlen(str, 0));
- }
- int nstrlen(char *str, int res)
- {
- int i = 0;
- for (i = 0; str[i] != '\0'; i++)
- {
- res = i+1;
- }
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement