简体   繁体   中英

Error with a statement: "expected ')' before ',' token

So I'm very new to coding and although I have found many answers to this same question, none of them seem to work for me. I am trying to make a constructor that takes multiple parameters for my class but the compiler always says that it is expecting me to end the constructor after the first string rather than allowing me to include all of the member variables in the one constructor.

Here's a snip of the constructors I have declared:

class studentType
{

public:

studentType();

studentType(string, string, char, int, int, double);

and the error says error expected ')' before ',' token which leads me to believe that it will only let me make a single parameter constructor but I know that that is not true. I have 6 member variables in my class and I need a constructor that will initialize all of them.

Any help would be greatly appreciated as I really thought I knew what I was doing and apparently I have no idea.

Include the required headers

#include <string>

using std::string;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM