additional info for c++
This commit is contained in:
parent
cbfbdab6c4
commit
4a9de2897c
11
cpp/instances/README.md
Normal file
11
cpp/instances/README.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# C++ Example
|
||||||
|
|
||||||
|
## Language Specific
|
||||||
|
|
||||||
|
c++ is almost identical to java in this example.
|
||||||
|
The only difference here is that c++ doesn't require the object
|
||||||
|
to be initialized with the keyword 'new'.
|
||||||
|
|
||||||
|
Relevant Files:
|
||||||
|
|
||||||
|
- [main.cpp](./main.cpp)
|
@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
// create a new car and store it in the variable 'a'
|
// create a new car and store it in the variable 'a'
|
||||||
car a;
|
car a;
|
||||||
// set some data for that car
|
// set some data for that car
|
||||||
a.manufacturer = "Benz";
|
a.manufacturer = "Benz";
|
||||||
a.model = "Velo";
|
a.model = "Velo";
|
||||||
|
|
||||||
// do the same for a second car
|
// do the same for a second car
|
||||||
car b;
|
car b;
|
||||||
b.manufacturer = "Ford";
|
b.manufacturer = "Ford";
|
||||||
|
@ -64,7 +64,7 @@ repository :)
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
- [Java](../java/instances)
|
- [Java](../java/instances/README.md)
|
||||||
- [Rust](../rust/instances)
|
- [Rust](../rust/instances/README.md)
|
||||||
- [C++](../cpp/instances)
|
- [C++](../cpp/instances/README.md)
|
||||||
- [JavaScript (using TypeScript)](../typescript/instances)
|
- [JavaScript (using TypeScript)](../typescript/instances/README.md)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user