+ 2

What is test in the following code?

please help me the code is #include <iostream> using namespace std; class BankAccount { public: void sayHi() { cout << "Hi" << endl; } }; int main() { BankAccount test; test.sayHi(); }

24th Apr 2017, 4:52 PM
Harikrishnan s
Harikrishnan s - avatar
2 Respuestas
+ 2
test is an object of class BankAccount
24th Apr 2017, 4:55 PM
⏩▶Clau◀⏪
⏩▶Clau◀⏪ - avatar
+ 2
Test is an object. It can be defined as an instance of the class. By typing 'BankAccount test'. you just created an object of the class BankAccount called test.
24th Apr 2017, 4:55 PM
Brendan Rovholo
Brendan Rovholo - avatar