Hey guys so I'm trying to get my program to work I'm in the final steps. I separated it into 3 files, privatizing my class into my main.cpp, joshsClass.cpp, and joshsClass.h.
Cant get it to run, the only error I'm getting is in the main.cpp function, ill comment it in the code.
main.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
#include <string>
#include "joshsClass.h"
usingnamespace std;
int main()
{
joshsClass key;
key.getName("Joshy Soshy Woshy"); // " Too many arguments to function called expected 0, have 1
cout << key.getName() << endl<<endl;
cout << "PROGRAM 'Variables in a Class' MADE BY JOSH GIALIS ON 2/14/16. \n\n\n ";
}
Thanks Tarik, I tried analyzing it and caught that error I just wasn't sure how to fix it. I didn't know that in declaring the class in the main i could use