Q&A Discussões
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 Votos
3 RespostasQuente hoje
Pig Latin
0 Votes
Please rate my code from 1 to 10
2 Votes
Square Roots
0 Votes
What's wrong with this?
1 Votes
Uuu
2 Votes
How to start
0 Votes
Recursion doubt
2 Votes