Hello,
I'm trying to pass an array of strings to a function by reference and can't seem to figure out how to do it. Here is what I'm tring to do.
#include <string>
void goodbye(string &ra[]);
int main();
{
int lines = 3;
string a[lines];
string a[0] = "Hello";
string a[1] = "there";
goodbye(a);
return 0;
}
void goodbye(string &ra[])
{
ra[0] = "goodbye";
ra[1] = "";
}
I know this isn't correct, but this is basically what I'm trying to do. Can anyone patch up this so that it would work or point me to a page with an explanation/tutorial? As of yet, google has failed me on this one.
Thanks in advance,
James1



LinkBack URL
About LinkBacks


