Обсуждения
can someone please explain why this code keeps telling me complication error instead of outputting the value of speed.
#include <iostream>
using namespace std;
class myClass {
public:
void setcarspeed (int a){
speed=a;
}
int getcarspeed(){
return speed;
}
private:
int speed;
};
int main() {
myClass obj;
obj.setcarspeed (40);
cout<<obj.getcarspeed ;
return 0;
}
2 голосов
3 ответовАктуальное сегодня
I need help to solve this
0 Votes
Project
0 Votes
Engineer Cloud
0 Votes
Lua?
1 Votes
How to add comment in python?
0 Votes
How do we code calculator
0 Votes