I am passing string 2d array to a function in a following way. Is it correct or can it be done better ?
#include<iostream>
#include<string>
using namespace std;
void print_name(string name[])
{
cout<<name[0];
}
int main()
{
string name[4];
name[0] = "abc";
name[1] ="xyz";
name[2] = "pqr";
name[3]= "xyq";
print_name(name);
return 0;
}
vector<string> name(4)here.