I've written the following program..but it doesn't work. Why?
It shows an error: cannot convert ‘std::string* {aka std::basic_string<char>*}’ to ‘std::string** {aka std::basic_string<char>**}’ for argument ‘1’ to ‘void print(std::string**)’|
#include <bits/stdc++.h>
using namespace std;
void print(string *ar[])
{
for(int i=0; i<5; i++)
{
cout<<*ar[i]<<endl;
}
}
int main()
{
string s[5];
for(int i=0; i<5; i++)
{
getline(cin,s[i]);
}
print(&s);
return 0;
}