I can not understand where naaportachil. I just started to learn C ++ and the primal is such a task, find the number of the letter "a" in the line that is passed to the function and output the number of these letters. Code means it looks like this.
char str(char *str[]) { int j = 0; for (int i = 0; i < sizeof(str) / sizeof(*str); i++) { if (str[i] == "a") { j++; } } return j; } Вызов функции в main. cout << str("saassssasasasass") << endl; So when I call the function, VS gives this error. What is the problem? And another question: why do we need the stars char *str[] and sizeof(str) / sizeof(*str)
