func mystr_len code
This commit is contained in:
15
str_len.c
Normal file
15
str_len.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
int mystrlen(const char *s);
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
printf("Print you string\n");
|
||||
char s[100]; scanf("%s", s);
|
||||
printf("You printed:%s\n", s);
|
||||
printf("Your str has:%d chars\n", mystrlen(s));
|
||||
return 0;
|
||||
}
|
||||
int mystrlen(const char *s)
|
||||
{
|
||||
return strlen(s);
|
||||
}
|
||||
Reference in New Issue
Block a user