I'm just trying to solicit input from the user and save it in the array in a separate function. I cant seem to get the syntax right, and dont quite know how to continue. could anyone point (haha) me in the right direction?
Yeah, arrays and pointers are confusing when you first approach them (and second approach, and third)
When you create an array you reserve a certain quantity of memory. This memory starts at the location pointed by array. So the original value (meaning the first value of the sequence) is pointed by array itself. To access the elements then you use the square brackets
In the prototype for getstring() you don't need to write the size of the array
In main() you are defining an array of 3 elements which holds pointers to strings (string*). If you do string array[3] you define an array of 3 elements which holds strings. Also, a std::string initialized to NULL has no meaning
The code for getstring() would have been correct if you had an array of pointers. Since you want strings you need to do just getline (cin, array[i]);
Thank you, but while this works for my current program, I have more functions to implement, and I think i need a pointer to the arrays. Eventually, ill be comparing the length of them, but for now ive just used 'cout' to see them to make sure im writing the code right. in my 'getmax' function, i can only output the last string ive entered.