Q&A Discussões
problem with asterisk
1 Voto
1 Respostacan 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 RespostasWhy not normal I/O
0 Voto
1 RespostaTime Limit exceeded
0 Voto
2 Respostaswhat will be output??
#include <iostream>
using namespace std;
int main(int a)
{
cout << a << "\n";
return 0;
}
int main(char *a)
{
cout << a << endl;
return 0;
}
int main(int a, int b)
{
cout << a << " " << b;
return 0;
}
int main()
{
main(3);
main("Subodh");
main(9, 6);
return 0;
}
if output is compilation compilation error then how can we overload "main" function in C++
0 Voto
5 RespostasTransparent Problems
0 Voto
1 RespostaWhy is there error?
0 Voto
2 RespostasIndetationError
0 Voto
1 RespostaQuente hoje
Data Analysis Course
1 Votes
Time up code for data revision
0 Votes
Web vs python
0 Votes
Is there LUA?
0 Votes