|
Re: Debug variables not showing correct values [message #1827396 is a reply to message #1827378] |
Thu, 14 May 2020 05:17 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
The debugger doesn't think anything.
It reports what the program does.
I ran your code and got the expected output.
Debugging and typed in "4321\n" and got
!!!Hello World!!!
4321
4321
Running and typing "5467\n":
!!!Hello World!!!
5467
5467
//#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
int a;
cin >> a;
cout << a;
if (a == 44) {
cout << "test"<< endl; // debugger goes to this line
}
return 0;
}
[Updated on: Thu, 14 May 2020 05:32] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.01937 seconds