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
Ai generated practices
2 Votes
Solving coding challenges
0 Votes
Feedback on my portfolio
0 Votes
Yo this is madness
0 Votes
Advertising in Sololearn
0 Votes
I am new
1 Votes
How can i insert files?
1 Votes