Re: No Error in The Program
Haven't looked at the link but, could it be that the console is opening, the program is running, and the coonsole is closing faster than you can see? Perhaps, open the command prompt and then run the program.
Re: No Error in The Program
This is when you use your debugger to see what your code is actually doing vs what you think it is doing.
Re: No Error in The Program
No offence ment but don't compact your code like that. As GCDEF pointed out the debugger is the absolutely fastest way to find out what's going on but with lines as compact as yours it will be hard to follow the execution (and of course also to read).
1 Attachment(s)
Re: No Error in The Program
Quote:
Originally Posted by
GCDEF
This is when you use your debugger to see what your code is actually doing vs what you think it is doing.
Quote:
Originally Posted by
S_M_A
No offence ment but don't compact your code like that. As GCDEF pointed out the debugger is the absolutely fastest way to find out what's going on but with lines as compact as yours it will be hard to follow the execution (and of course also to read).
I agree with you but when i run it, it shows me that sorta message, how do i fix it?
Check the screenshot that i have attached with it.. and tell me the solution !!
Re: No Error in The Program
Quote:
Originally Posted by
joannesablad
I agree with you but when i run it, it shows me that sorta message, how do i fix it?
Check the screenshot that i have attached with it.. and tell me the solution !!
Why don't you so as the dialog says --
Hit Retry.
Then you will see what is causing the issue by looking at the call stack to see which string is bogus.
Regards,
Paul McKenzie
Re: No Error in The Program
Quote:
Originally Posted by
joannesablad
I agree with you but when i run it, it shows me that sorta message, how do i fix it?
Check the screenshot that i have attached with it.. and tell me the solution !!
Also, debugging doesn't just mean starting the debugger and running the program.
How about single-stepping in your program, set breakpoints, watch variables, etc.?
Regards,
Paul McKenzie
Re: No Error in The Program
Quote:
Originally Posted by
Paul McKenzie
Why don't you so as the dialog says --
Hit Retry.
Then you will see what is causing the issue by looking at the call stack to see which string is bogus.
Regards,
Paul McKenzie
I have tried many times but i'm not able to find the mistake!..
can anyone of you fix that code and send me?
Re: No Error in The Program
Quote:
Originally Posted by
joannesablad
I have tried many times but i'm not able to find the mistake!..
When you hit Retry, what do you see? Where in the call stack is your code that is causing the error?
Quote:
can anyone of you fix that code and send me?
You wrote the code, so you must learn how to fix your own code.
Learning how to debug is part and parcel of learning how to write a program. Do you think that all of us here write perfectly working programs and never need to debug them? CodeGuru is not a "I write code, you debug it for me while-I-wait" site or forum.
Regards,
Paul McKenzie
Re: No Error in The Program
Quote:
Originally Posted by
joannesablad
I have tried many times but i'm not able to find the mistake!..
can anyone of you fix that code and send me?
You can't post here every time something doesn't work. Learn to use the debugger. It's use is not optional. I've been programming for decades and I still run just about every piece of code I write in the debugger to make sure it's doing what I think it is.
Re: No Error in The Program
Quote:
Originally Posted by
GCDEF
You can't post here every time something doesn't work. Learn to use the debugger. It's use is not optional. I've been programming for decades and I still run just about every piece of code I write in the debugger to make sure it's doing what I think it is.
well i'm just new to programming, this is my 2nd month i started learning and i'm in trouble. i'm not a good programmer..
Re: No Error in The Program
Quote:
Originally Posted by
joannesablad
well i'm just new to programming, this is my 2nd month i started learning and i'm in trouble. i'm not a good programmer..
I don't have anything to open .rar files so I can't see your message, but it sounds like if one of the options is to hit Retry, that's what you should do. That will take you to a function when an ASSERT macro has been triggered indicating an unfavorable condition has been met. More than likely you can tell from the code what is wrong.
From there, open the call stack window and find the last line of code you wrote. Examine the values of the local variables and see what isn't what it's supposed to be.
Re: No Error in The Program
Quote:
Originally Posted by
joannesablad
well i'm just new to programming, this is my 2nd month i started learning and i'm in trouble. i'm not a good programmer..
Then this is an excellent time to learn how to debug. It's a critical skill you will need going forward.
Re: No Error in The Program
Quote:
Originally Posted by
joannesablad
well i'm just new to programming, this is my 2nd month i started learning and i'm in trouble. i'm not a good programmer..
But the debugger requires very little programming knowledge. As a matter of fact, the debugger will teach you how your program behaves.
Start your program by hitting F10. Do you see the first line with an arrow pointing to it? That is the first line that will be executed. Now hit F10 again. Do you see the arrow move down? That is the next line that will be executed, etc.
In other words, you see exactly what steps your program makes in "slow motion", instead of just running it until the end.
How hard could that be, seriously? Then you learn the other commands that steps into functions, sees the values of variables, set breakpoints etc. Once you determine the line of code that blows up the program, then you dig deeper and see what the values of those variables are (just rerun the program using the debugger) to cause the crash. If you still don't know, then tell us what you observe -- that's the least that's expected from someone posting code they wrote and can't figure out what's wrong.
Regards,
Paul McKenzie