some changes ; mostly new examples
This commit is contained in:
22
OOP/methodes/car_speed.cpp
Normal file
22
OOP/methodes/car_speed.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <iostream>
|
||||
|
||||
/*
|
||||
This here that we have is just another demo of the OOP in c++ ; we have the function that we have in the last example and then we usefully do something
|
||||
with this function ;
|
||||
*/
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Car {
|
||||
public:
|
||||
int speed(int max_speed);
|
||||
};
|
||||
|
||||
int Car::speed(int max_speed) {
|
||||
return max_speed;
|
||||
}
|
||||
|
||||
int main() {
|
||||
Car volvo;
|
||||
volvo.speed(600);
|
||||
}
|
||||
Reference in New Issue
Block a user