#include <stdio.h>
/*
Quanti caratteri contiene una stringa?
*/
char a[] = "questa è una stringa";
int my_strlen(char s[]) {
int i; // ci serve per contare i caratteri
for(i=0; a[i] != '\0'; i++) ;
return i;
}
int main() {
int l=0;
l = my_strlen(a);
printf("lunghezza \"%s\" = %d",a,l);
}
To embed this project on your website, copy the following code and paste it into your website's HTML: