FYI, your link behaves as if it's badly formed, because the forum software considers the closing bracket and full-stop as if they're part of the URL, and so includes them in the link.
If you edit it to add whitespace between the actual URL and the closing bracket, it will be properly clickable.
EDIT: Regarding the OP's question - you don't need to prefix method names with ClassName:: when you're declaring/defining them inside the class definition. The ClassName:: is automatically assumed, because you're already inside class ClassName { ... }.
FYI, your link behaves as if it's badly formed, because the forum software considers the closing bracket and full-stop as if they're part of the URL, and so includes them in the link.
Oops, thanks for that Mikey.
the page you suggested doesn't inherit constructor
why are you using carType when constructors are in the class?
could you explain me that?
@ world
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class className : public NameType; // is this the correct initialization to inherited a class from a class ?
{
// constructor
className : : className();
// gettters
className : : getName()
{
return firstName;
}
// settters
className : : setName(string name )
{
firstName= name;
}
}
no.
there is no semi-colon at the end of line 1.
you need to add a semi-colon at the end of your class declaration. (line 16)
Your getName() method must have a return type.
The scope resolution operator is '::' i.e. no space inbetween them.
you need to declare firstname as a member variable of your class.
and as poeple keep telling you, if you are putting the method implementations inside your class you DO NOT need "class::" prefixes.
EDIT: Regarding the OP's question - you don't need to prefix method names with ClassName:: when you're declaring/defining them inside the class definition. The ClassName:: is automatically assumed, because you're already inside class ClassName { ... }.