22 lines
401 B
C++
22 lines
401 B
C++
#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);
|
|
} |