Sign in to follow this  

c++ help

This topic is 4250 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Quote:
Original post by Anonymous Poster
looks like homework! Shame on you!




it is, I figured out all the code and everything, just cant get the .txt file to load properly

Share this post


Link to post
Share on other sites
C++ is a declarative programming language. It executes one instruction at a time, in order. main() is the first function that is entered in the program. The first instruction executed is double testArray[10];. You are calling stdDev() and calculating your values before you even open the file and read in any data. It looks like you are reading the values in from the file correctly (you might want to check that you are actually ignoring the first line, as I don't see that code that's doing that).

Use the debugger and step through your program 1 instruction at a time. It will help you see how functions are entered, and the values of your variables at each instruction.

Share this post


Link to post
Share on other sites

This topic is 4250 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this