problem with gdb
hello all, I have a strange problem with GDB. when i print a value of an integer using 'print' command in gdb it gives an an incorrect value. however if i run the program in console and print the same integer value from my program it gives me the right value.
see the program below, problem is concerning variable 'file_des'
file_des = open("output.txt", (O_RDWR | O_APPEND | O_CREAT), 0666);
printf("\nstandard output redirected");
printf("\nfile_des = %d", file_des);
at the last line of the program, when i print file_des in gdb, it shows a value 7. when i run the program in console it prints value 3.
does anyone has a clue ??