#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
char s[] = "Some text";
k=*s
int main ()
{int strlen(char *s);
strlen (k)
}
int strlen (char *s){
int n;
for (n=0; s!='\0'; s++)
n++;
cout<<n;
return 0;
}
I want to test the strlen (with a pointer argument) function on the char array 's'. Could you help me do it? I have tried doing a lot of things but I always get errors. (I saw this strlen decalration in c handbook so it may work differently in c++)