question about gdb, how to debug a program with input file
I just want to know how to use gdb if I want to see the value of my variable, that I get from a file.
To make it clear I will give an example:
lets say I have a file 'str.txt'
and a program that counts the word "daniweb".
to just run this program I would type something like this:
$ program.c < str.txt > program
and it would give a result lets say 5
So my question is how can I debug my program with this file
I want to get something like this:
gcc -g program.c -o program
(gdb) p count = 3 // count is counting word daniweb
Related Article:Help with VPS?
is a Linux and Unix discussion thread by fuggles that has 2 replies, was last updated 1 year ago and has been tagged with the keywords: apache.