I took a look at your program...
Turn on debugging information under linker settings and run debug. Put =
breakpoints (by clicking on the line number in the gutter) in your =
program to specify when you want to check the values. Instead of running =
your program, click on debug. Add a watch for every variable you want to =
check - and step through your code by clicking on 'next step'. It will =
help if you resize the windows so both DevCpp and your pragram windows =
are visible. It gets a bit tricky when you get to the scanf function, =
but you'll get it.
As for the bug in your program - you'll notice that you are dividing two =
integers and storing the result in a float. To get a float value, you =
will need to typecast, or declare suma as a float variable too.
replace:
media =3D (suma / ELEMENTOS);
with:
media =3D ((float)suma / ELEMENTOS);
hope this helps.
-d-
----- Original Message -----=20
From: jose gonz=E1lez=20
To: Dev...@li...=20
Sent: Monday, May 12, 2003 12:40 PM
Subject: [Dev-C++] debugging
Please , I need some basic tips to debugging a little program with =
devcpp 4.9.8.0.
Thank you |