ok here is the file with the fuction.... it is 317 lines (one function ) i could probably break it up too.
ok here is the file with the fuction.... it is 317 lines (one function ) i could probably break it up too.
Last edited by c++.prog.newbie; 02-12-2005 at 07:48 PM.
Are you kidding me? You really want someone to go through all that.
Try adding a left brace at the end of the function.
i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced
It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem
Can't work it out - the main problem is the length of your function
Each function should have one logical purpose
so instead have something like:
Splitting this up will make it readable and more logical.Code:void startSelection1() { char ch = printMenu1(); switch(ch) { case 'g': // do something // e.g startSelection2 case 'f' // do something else } } char printMenu1() { char t; // print out first menu // get input from user return t; } //then for further menus do something similar;
(and help you find errors!)
fine ill do something senseable and split it up into smaller functions
I'm serious its missing a closing bracket, oops I meant right brace.Try adding a left brace at the end of the function.
i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced
It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem
Believe it or not i split the function up and guess what!!!! i found the problem !!!! but im not too sure what it was( i think you were right with the closing bracket)
but now I get this
[code]
main.cpp C:\arg\main.o(.bss+0x0) multiple definition of `spells_b'
[\code]
i get this error because im declaring struct spells_b in the header because i need it in both .cpp's which brings me back to one of my previous questions... were do i put variable that i need in both .cpp's??
thx for all the help guys(and gals )
Place it in one header file and be sure to include the header file in all the files that need it.
i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced
It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem
i have the variables in one file. and the files that need it link to that file (#include "blah.h") but it says its declared first in blah.h then in main.cpp i look all through main and nothing declaring.
I think you need to reread the FAQ
i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced
It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem
i read, reread, and rereread the FAQ's but i didnt see anything about were to declare variables globaly that will be in both .cpp's unless the answer is just staring me in the face and im looking past it.
EDIT:
^ me right nowIt is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah
Last edited by c++.prog.newbie; 02-12-2005 at 07:26 PM.