[Dev-C++] how to pass a string array to another function
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Brad <nyc...@gm...> - 2012-09-17 11:40:41
|
My situation is this, I have a string array that I am trying to get the data
to another function but have issues with the return type conflicting with
either the function definition or the array data being passed.
std::array Array[2]
std::string f()
{
array[0]=ted
array[1]=bundy
return Array[2];
}};
void printarray (int arg[], int length) {
for (int n=0; n<length; n++)
cout << Array[n] << endl;
}
int main ()
{
printarray();
return 0;
}
Brad
|