Why isnt this working? printf doesnt print variable inside a if block? Works outside?
Expand Post »
I have a small problem. I'm curious to see why this happens. If you run this code and enter the data, I put in a debug line. Inside the 'if (grade2>grade) block, the DEBUG printf's don't show the data correctly.
Outside the if block, I print pretty much the same line. It shows it correctly on that line.
Anyone know why? I'm learning a lot about c as I go. Thanks!
Re: Why isnt this working? printf doesnt print variable inside a if block? Works outside?
thanks kbs. I looked at what you suggested and saw that I had mis-understood how C takes in datatypes. I fixed all the misrepresentations in my code and it works fine now.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.