Finding what wrong...

I am new to c++(i am taking it as my first serious programming language)
http://www.cplusplus.com/forum/articles/12974/
I was doing Dungeon challenge code when my code got really confusing and it became hard to find out what i did wrong to get bad results . Well i am wondering if there is a programme able to break down what is going on the console . For example: main function running.....cin<<x=6... function(int x=4,int y=5) loop first run(4<7) secondrun(6<7) loop ended(8<7=false)......
I dont know exactly but i am looking something that can show at real time what values are going in variables and functions and simplify the task to find out what is wrong......
Last edited on

What your looking for is a debugger, and all decent IDE's have them.
Oh i heard sometimes about that but never learnt about it . I have code block it can debug easily?
(*going to sleep wont answer until tommrow*)
Last edited on
closed account (NUj6URfi)
Just set up a bunch of cout statements to tell yourself that.

E.g:
1
2
3
4
5
6
7
include <iostream>;

int main() {
std::cout << "Main is starting" << endl;
cin.get();
return 0;
}

A debugger allows you to step line by line through your source code and add watches (i.e. watch a variable and its value). I don't personally use code::blocks but I am led to believe its decent.

I am a avid Visual Studio user, been that since the first version many moons ago, apart from Eclipse when I'm doing Android work.

Thanks everyone
I will fellow your link giblit
@toad i tried that but with many variables and functions it can become confusing
Topic archived. No new replies allowed.