New course! Every coder should learn Generative AI!
Try a free lessonQ&A Discussions
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 AnswersHot today
Does everyone get this for free?
4 Votes
Dynamic library lib file
0 Votes
[Solved] What will happen if we don't delete an array created by using Dynamic Memory in C++?
1 Votes
HTML5 canvas
1 Votes
Jobs
3 Votes
Can we convert website into app
1 Votes