For this part, I don't want to read from a file and ask the user for the inputs.
I'm having a few problems. My program will run as is, but when asking the user for the input, I'm having issues:
- Getting rid of the '<'
- Capitalizing the second first letter
- Substituting '_' for space
- Getting rid of the '>'
This is how I think it should be, but I can't get it to work once I remove the lines I'm working on from the comments.
Thanks,
1 2 3 4 5 6 7 8 9 10 11
int main ()
{
char fileName[256];
getFileName(fileName);
char array[MAX_WORDS][MAX_WORD_SIZE];
readFile(fileName, array);
cout << "Thank you for playing.\n";
return 0;
}
Ok,
The reason the commented-out part won't work is because you can't use an array like normal after getting it passed in a function.
Use a for loop inside the function like this:
1 2
for(int i = 0; i < arraylength; i++)
localarray[i] = *(passedarray + i);
Localarray is an array declared inside of a function and passedarray is the name of the array passed into a function.
Does this answer your question?