I tried to get the length of the string array, and I've done it in the main function and it worked. Afterwards I needed to do so in a function, but it doesn't identifies the functions with error:
IntelliSense: no instance of overloaded function "begin" matches the argument list
code:
void fun(string arr[])
{
cout << end(arr) - begin(arr);
}
void main()
{
string arr[] = {"This is a single string"};
fun(arr);
}
also for the end.
So I added the pointer symbol '*' and the error disappeared, but it returns me the length of the first item in the array.
Why do I get this error? How to fix it?