Recently i was working on my project, I came to the last question of my project. i totally understand the question but when i implemented it in Visual Studio 2008 (C++ Express Edition).
my program was build successfully and there is not even a single error in my program but its not running? i can't see the console and i don't understand the error which i'm having. i tried it on different computers and different VB C++ but all in vain, nothing happening.
Can you please Run this code in your C++ and tell me whats the problem which i'm having in it!
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.
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).
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
- Brian W. Kernighan
This is when you use your debugger to see what your code is actually doing vs what you think it is doing.
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 !!
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?
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.
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.
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..
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.
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
Last edited by Paul McKenzie; January 3rd, 2012 at 01:34 PM.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.