mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Added correct syntax for c++ inheritance.
[more] Minor indent correction at namespaces intro example
This commit is contained in:
parent
b6ba516743
commit
7b95a1e921
@ -132,7 +132,7 @@ namespace myFirstNameSpace
|
|||||||
cos(int x)
|
cos(int x)
|
||||||
{
|
{
|
||||||
printf("My inner soul was made to program.");
|
printf("My inner soul was made to program.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,10 +266,9 @@ int main () {
|
|||||||
|
|
||||||
//C++ Class inheritance
|
//C++ Class inheritance
|
||||||
|
|
||||||
class German_Sheperd
|
class German_Sheperd : public Doggie
|
||||||
{
|
{
|
||||||
//This class now inherits everything public and protected from Doggie class
|
//This class now inherits everything public and protected from Doggie class
|
||||||
Doggie d_dog;
|
|
||||||
|
|
||||||
//Good practice to put d_ in front of datatypes in classes
|
//Good practice to put d_ in front of datatypes in classes
|
||||||
std::string d_type;
|
std::string d_type;
|
||||||
|
Loading…
Reference in New Issue
Block a user