I have changed line 17 in the function printResults to:
1 2 3
|
sumVotes = temp.getTotalVotes() ;
|
and now I get this from the compiler log:
Chapter 10 Source Code\Ch10_ElectionProgram\electionResult.cpp: In function 'void printResults(orderedArrayListType<candidateType>&)':
C:\Martin\MalikDownloads\Chapter 10 Source Code\Ch10_ElectionProgram\electionResult.cpp:150:19: warning: name lookup of 'i' changed [enabled by default]
C:\Martin\MalikDownloads\Chapter 10 Source Code\Ch10_ElectionProgram\electionResult.cpp:136:13: warning: matches this 'i' under ISO standard rules [enabled by default]
C:\Martin\MalikDownloads\Chapter 10 Source Code\Ch10_ElectionProgram\electionResult.cpp:145:15: warning: matches this 'i' under old rules [enabled by default]
C:\Martin\MalikDownloads\Chapter 10 Source Code\Ch10_ElectionProgram\electionResult.cpp:132:13: warning: variable 'sumVotes' set but not used [-Wunused-but-set-variable]
C:\Martin\MalikDownloads\Chapter 10 Source Code\Ch10_ElectionProgram\electionResult.cpp:132:38: warning: variable 'winLoc' set but not used [-Wunused-but-set-variable]
mingw32-g++.exe -o "bin\Debug\Election Results.exe" "obj\Debug\MalikDownloads\Chapter 10 Source Code\Ch10_ElectionProgram\candidateTypeImp.o" "obj\Debug\MalikDownloads\Chapter 10 Source Code\Ch10_ElectionProgram\electionResult.o" "obj\Debug\MalikDownloads\Chapter 10 Source Code\Ch10_ElectionProgram\personTypeImp.o"
Output file is bin\Debug\Election Results.exe with size 1.02 MB
Process terminated with status 0 (0 minute(s), 4 second(s))
0 error(s), 5 warning(s) (0 minute(s), 4 second(s))
-------------- Run: Debug in Election Results (compiler: GNU GCC Compiler)---------------
Checking for existence: C:\Martin\Election Results\Election Results\bin\Debug\Election Results.exe
Executing: "C:\Program Files\CodeBlocks/cb_console_runner.exe" "C:\Martin\Election Results\Election Results\bin\Debug\Election Results.exe" (in C:\Martin\Election Results\Election Results\.)
Process terminated with status 255 (0 minute(s), 10 second(s))
-------------- Run: Debug in Election Results (compiler: GNU GCC Compiler)---------------
Checking for existence: C:\Martin\Election Results\Election Results\bin\Debug\Election Results.exe
Executing: "C:\Program Files\CodeBlocks/cb_console_runner.exe" "C:\Martin\Election Results\Election Results\bin\Debug\Election Results.exe" (in C:\Martin\Election Results\Election Results\.)
Process terminated with status -1073741510 (0 minute(s), 12 second(s))
The program runs and it then bombs out.
Please help!!!