When you call void nameEvent(string locN[], string orgN[]) on line 13 your compiler thinks it doesn't exists yet. It looks for a declaration (a prototype) that it can look at BEFORE the current line.
But you declared and defined it below main. It is not visible to any of the code above it unless you put a declaration before main.
Your compiler goes line-by-line. If you have no defined something BEFORE that line, the compiler will not recognize its existence.
Just add void nameEvent(string locN[], string orgN[]); before main and then your code in main will know what 'namedEvent' looks like. You can keep the definition below main, that's fine.
1 2
nameEvent(locN, orgN);
cout << locN << endl;
Those variables are undefined. You didn't declare them anywhere.
You did not give a prototype BEFORE that function call that your compiler can look at. When it parses nameEvent(locN,orgN);, it hasn't actually found that function yet since you declared it AFTER the call. You need to provide a declaration that your compiler can see so that it know what namedEvent is.
Why are you using arrays of strings?
You just want to get one string from the user, which the location, right?
And then you want one more string, which is the name of the volunteer event, right?
std::string locationN[50]; That creates an array of 50 strings.
'\n';
What is this doing? It's just sitting off by itself.
std::string orgN[50];
Redefinition of argument string orgN[]. Compiler will be unhappy.
It looks like you want to use a function to get input, but you want to remember that in main, right?
A better way to do this would be to send the strings in by reference. When you do that, any changes to the strings inside of your function will be reflected in the same strings that you passed into the function.
so what I was doing with the '\n' was to create a new line. what I'm trying to do is get information from the user of the name of their organization and the location of it which will be done in the function. then passed to the main where it'll be displayed.
Hmm. I see. I won't do something you haven't learned yet. That would just piss off your teacher.
I'll avoid using anything that I think you might not have learned.
Alright. How about you use two different functions for input? Each function can only return one value, so you can use two functions - one to get the location, and one to get the activity.
Why not try something like this?
1 2
string getLocation();
string getVolunteerEvent();
Those functions don't take any arguments, but they will return a string. You could get a string from the user inside the functions and then return the strings that the user enters and store that in a variable declared in main.