not sure why but none of my function calls are working the funcctions themselves have out put when i make them programs on their own but as functions all that outputs is "hello." I'm new and really stuck been trying for a week now, any help would be appreciated. bellow is my main function with the calls. array_ in the name is just so i can keep track of what array is in what function.
You're putting function declarations in another function's body. They're not called.
Let me explain your code.
1 2 3 4 5 6 7 8 9 10 11 12 13
void main()
{
cout << "\nhello.\n"; // print hello to the screen
void array_names(...); // telling the compiler I have a function called array_names
{
} // doing nothing
... // same as above
system("pause");
}
In C/C++, you can't implement a function inside another function. You have to do it like this:
1 2 3 4 5 6 7 8 9
void array_names(...)
{
// your implementation to array_names
}
void main()
{
array_names(...); // call array_names
}