Q&A Discussies
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 Stemmen
3 AntwoordenPopulair vandaag
Debugging issue?
0 Votes
Text editor
0 Votes
how to view only application
0 Votes
I’m really confused
0 Votes
What is Typecasting?
1 Votes
Subscription
0 Votes
Stream
0 Votes
Scraping
0 Votes
Make a app
0 Votes