I'm getting this error, "expected primary-expression before ',' token" for the project I'm working on. For my project, I have to have the user input a text file using the text file's name as a string, where I will use ifstream to extract data from the textfile, and input the data into an array of structs. We are to use 3 text files, named one.txt, two.txt, and three.txt. I used a cin to input the file name, and the function c_str to convert the string to a cstring, but I am getting that error on line 40. I'm new to coding, so any pointers would be very helpful. Thanks!
getdata(filename.c_str(), birds, max_size);
You cannot provide a const value since getdata(..., int& listSize) requires a non const value. create a variable for that.
there are two errors. The first argument shall be of type ifstream& and instead of type specifier birds there shall be an object of type pointer to birds.
I created the variable, int number, to fill in for listSize in the function, but It's yielding the same error for me. Is there an issue with the way I've called my function? I'm a little shaky on functions so I'm not entirely sure I'm doing it right.