i keep getting this error: error: expected ‘)’ before ‘,’ token
this is the code i'm using:
dragon(string str = "wild dragon", int level = 5);
this is inside a the dragon class definition.
dragon::dragon(str,level) {
name = str;
tp = ((rand() % 6) + 1);
type = tp;
lvl = level;
setatk();
setdef();
setexpmax();
sethpmax();
hp = hpmax;
setacc();
setout(false);/* set to conscious */
}
this is where the class is instantiated:
pets[i] = new dragon(name,level);
the variables name and level where assigned earlier in the loop.
could someone give me a hint where i'm going wrong?
this is a text based rpg i'm doing for fun.