[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
CppInstance
Displaying differences between revision 6 and the latest revision


= ([[CCplusplus | C++]]) instance =

After having specified a data type (e.g. a class) 'bringing it to livfe'.

In the code below, myClass is an instance of the class MyClass. Also myOtherClass is an instance of MyClass.
[code]
#include <iostream>
MyClass
{
public:
MyClass() { std::cout << "Hello world" << std::endl; }
};

int main()
{
MyClass myClass;
MyClass myOtherClass;
return 0;
}
[/code]

== Topic links ==
* #include
* iostream
* class
* public
* std
* scope operator[blue]'::'[/blue]
* cout
* stream out operator '[blue]<<[/blue]'
* endl
* main
* return



last edited (November 15, 2006) by bilderbikkel, Number of views: 11114, Current Rev: 7 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Site Management by Lars Hagelin at Kontantkort.se.