im starting a sub proceedure to test program once its worked through earlier processes. however to test the program, i have copied and pasted pieces of the program before hand, and because ive used the same variables they need to be declared again. but since things are stored in these variables, if i declare them again will they be overwriten or something or will the values that were there before be saved?
666kennedy 0
Junior Poster in Training
Recommended Answers
Jump to PostIf you mean you are using variable names in other functions, that's no problem. The names will be only visible within the function in which declared.
Look up "scope" in relation to C++ variables.
Jump to PostPlease post the full program (or enough of it to see just where this conflict is arising.) Your problem is not evident in the single function.
On thing that will cause runtime problems is your method of repeating the process:
if ( (ERRC + ERRD) < …
All 6 Replies
vmanes 1,165
Posting Virtuoso
666kennedy 0
Junior Poster in Training
vmanes 1,165
Posting Virtuoso
666kennedy 0
Junior Poster in Training
vmanes 1,165
Posting Virtuoso
666kennedy 0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.