#include <iostream>
#include <string>
using namespace std;
const int NUM = 3;
void hola(string &mana[])
{
mana[0] = "Hola soy sergio";
mana[1] = "Mamam me quierre";
mana[2] = "Hola como estas";
}
int main()
{
string mana[NUM];
hola(mana);
string *p = mana;
for (int i = 0; i < NUM; i++)
{
cout << *p++ << endl;
}
return 0;
}
In this code I want to print with the pointer the 3 sentences per screen but for some reason I get an error where it says that I have not defined my array within the function, but I send it as a reference parameter and still not Accept my array.
What is my problem in this code? Thank you very much for your help.?