help
-
#include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); abc: cout<
-
#include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); abc: cout<
-
#include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); abc: cout<
Did you compile this code?
-
Did you compile this code?
-
-
-
it is the new code changed by me follow,but it also have one error. #include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); cout<
-
#include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); abc: cout<
youbo wrote:
};where is the error...
The "error" is that you did not use the debugger.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
it is the new code changed by me follow,but it also have one error. #include using namespace std; int oo(int m); int sum=0; void main() { int m; cin>>m; oo(m); cout<
youbo wrote:
the error is :fatal error C1004: unexpected end of file found
See here. Had you used <pre> tags, and proper indentation, you could have quickly seen the error:
using namespace std;
int oo(int m);
int sum=0;
void main()
{
int m;
cin>>m;oo(m); cout<Once you address the C1004 error, you'll still be presented with a LNK2001 error, however. And to top it all off, a stack overflow is imminent.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Little tips for coding: 1) use longer names for varaibles and functions (this helps to understand what the code do) 2) do not use
goto
:omg:... find other ways when possible: in your case you canreturn -1;
or something similar :-D
Russell
having been brought up from coding raw hex on an 8080 SDK through Assembler and on into C and C++ I have no qualms about using goto. goto is after all just a JMP return -1 is also a JMP. break is also a JMP. why are you threatened by goto?
-
having been brought up from coding raw hex on an 8080 SDK through Assembler and on into C and C++ I have no qualms about using goto. goto is after all just a JMP return -1 is also a JMP. break is also a JMP. why are you threatened by goto?
Because you don't
goto
the middle of another function.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
having been brought up from coding raw hex on an 8080 SDK through Assembler and on into C and C++ I have no qualms about using goto. goto is after all just a JMP return -1 is also a JMP. break is also a JMP. why are you threatened by goto?
I wrote "....when possible..." ;) It is a bad pratique (for me). It is demonstrated that we can do everything without the use that keyword. Of course I use it (sometimes)....but I'm not a newbie like him:-D First you have to learn how make addictions by hand....and after that you can use the calculator:) :rose:
Russell
-
Because you don't
goto
the middle of another function.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
obviously you have never disassembled BIOS. JMPing into the middle of functions is common practice in every BIOS I have ever disassembled.
-
obviously you have never disassembled BIOS. JMPing into the middle of functions is common practice in every BIOS I have ever disassembled.
-
obviously you have never disassembled BIOS. JMPing into the middle of functions is common practice in every BIOS I have ever disassembled.
Last time I checked, Roger, we were discussing a C program.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
having been brought up from coding raw hex on an 8080 SDK through Assembler and on into C and C++ I have no qualms about using goto. goto is after all just a JMP return -1 is also a JMP. break is also a JMP. why are you threatened by goto?
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->ßRÅhmmÃ<-·´¯`·.