+ 2
Why this program does not work on the 7 line have brackets?
#include <iostream> using namespace std; class bankAccount { public: void bankAccount() { ^ | | int pass; cin >> pass; if(pass == 22547) { cout << "Hi !" << endl; } else if(pass != 22547) { cout << "Error" << endl; } } }; int main() { bankAccount test; test.bankAccount(); return 0; }
1 Réponse
+ 4
rename the method, a method can't have the class name (conflict with constructor)