Discussions Q&R
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 Votes
3 RéponsesAujourd'hui en vedette
Audio adding
1 Votes
playground input
0 Votes
What is problem in this code
0 Votes
Software developer
0 Votes
How I can use div
0 Votes
TIPS From Veterans
1 Votes
Html issue
0 Votes