Dyskusje Q&A
Cin/cout/cerr
0 głosów
1 Odpowiedźc++
1 Głos
3 odpowiedziHelp
0 głosów
3 odpowiedziNo output in my code???
0 głosów
3 odpowiedziIf-else problem
1 Głos
6 odpowiedziExecution time
1 Głos
1 OdpowiedźC++ Question
3 głosów
3 odpowiedziTimer?
1 Głos
1 OdpowiedźC++ Question
3 głosów
1 OdpowiedźWhat is wrong with this
0 głosów
2 odpowiedziHow can declare a word?
0 głosów
2 odpowiedziWhat's wrong?!
2 głosów
3 odpowiedziPost- cin Text?
0 głosów
3 odpowiedziC++ help
-1 Głos
2 odpowiedziIn the code below the output is 2. This code is used in a challenge and I get an error when I select the answer 2. It accepts as correct the answer 1 which I believe is wrong. If you agree please thumbs up.
If you find any other errors please post them here!
#include <iostream>
using namespace std;
int main()
{
for(int i=1; i>=1; i++) {
if(i<1 || i>1){
cout << i;
break;
}
}
return 0;
}
8 głosów
8 odpowiedzican anyone plz explain me this program step by step?#include <iostream>
using namespace std;
class MyClass {
public:
int var;
MyClass() { }
MyClass(int a)
: var(a) { }
MyClass operator+(MyClass &obj) {
MyClass res;
res.var= this->var+obj.var;
return res;
}
};
int main() {
MyClass obj1(12), obj2(55);
MyClass res = obj1+obj2;
cout << res.var;
}I am not getting the part inside operator+
0 głosów
8 odpowiedziWhy it doesn't work?!
2 głosów
5 odpowiedziPopularne dzisiaj
How would you solve the part of the C# Intermediate code project that requires operator overloading?
0 Votes
Kernel in Jupyter
2 Votes
SQL
2 Votes
JAVA PROGRAMMING
1 Votes
IMAGE
0 Votes