[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppInstance
In the code below, myClass is an instance of the class MyClass. Also myOtherClass is an instance of MyClass.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppInstance
(C++) instance
After having specified a data type (e.g. a class) 'bringing it to life'.In the code below, myClass is an instance of the class MyClass. Also myOtherClass is an instance of MyClass.
MyClass { public: MyClass() { std::cout << "Hello world" << std::endl; } }; int main() { MyClass myClass; MyClass myOtherClass; return 0; }
- include <iostream>
Topic links
- #include
- iostream
- class
- public
- std
- scope operator'::'
- cout
- stream out operator '<<'
- endl
- main
- return
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
