Dyskusje Q&A
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 głosów
3 odpowiedziPopularne dzisiaj
Need suggestions
0 Votes
Best code for creating games?
0 Votes
Java full stack
0 Votes
Calculator
0 Votes
progaming
0 Votes
Duration of heart refilling
0 Votes