test_answers[count}
number_of_correct_answers
but I still have red lines under a cin all count variables and the else
|
|
|
|
1> array program.cpp 1>l:\comp sci stuff\array program\array program.cpp(11): error C2040: 'answers' : 'char [20]' differs in levels of indirection from 'char' 1>l:\comp sci stuff\array program\array program.cpp(15): error C2373: 'test_answers' : redefinition; different type modifiers 1> l:\comp sci stuff\array program\array program.cpp(7) : see declaration of 'test_answers' 1>l:\comp sci stuff\array program\array program.cpp(17): error C2065: 'count' : undeclared identifier 1>l:\comp sci stuff\array program\array program.cpp(17): error C2373: 'test_answers' : redefinition; different type modifiers 1> l:\comp sci stuff\array program\array program.cpp(7) : see declaration of 'test_answers' 1>l:\comp sci stuff\array program\array program.cpp(20): error C2065: 'count' : undeclared identifier 1>l:\comp sci stuff\array program\array program.cpp(20): error C2065: 'count' : undeclared identifier 1>l:\comp sci stuff\array program\array program.cpp(21): error C2109: subscript requires array or pointer type 1>l:\comp sci stuff\array program\array program.cpp(23): error C2065: 'count' : undeclared identifier 1>l:\comp sci stuff\array program\array program.cpp(23): error C2065: 'count' : undeclared identifier 1>l:\comp sci stuff\array program\array program.cpp(23): error C2065: 'count' : undeclared identifier 1>l:\comp sci stuff\array program\array program.cpp(23): error C2065: 'count' : undeclared identifier ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== |
|
|
|
|
test_answers[count] = toupper(test_answers[count]); |
|
|
|
|
1> array program.cpp 1>l:\comp sci stuff\array program\array program.cpp(21): warning C4700: uninitialized local variable 'student_answers' used 1> array program.vcxproj -> L:\comp sci stuff\array program\Debug\array program.exe ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== |
char student_answers = 20;
first, then re-declared it as char student_answers[student];
.
char student_answers = 20;
to match the way I have my other array I still get the warning with the debug error when it runs.
|
|
1> array program.cpp 1>l:\comp sci stuff\array program\array program.cpp(21): warning C4700: uninitialized local variable 'student_answers' used 1> array program.vcxproj -> L:\comp sci stuff\array program\Debug\array program.exe ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== |
char student_answers = 20;
and char student_answers[student];.
. They have the same name which cause a conflict also the variable type is a char student_answers yet you gave it an int value. You can cout that variable and its not what you want.
char student_answers = 20;
? If so, I don't see why because as far as initialization and declaration don't they match and if so how are different in the way that's causing the warning.
|
|
char student_answers[student];
student_answers[student] = toupper(student_answers[student]);
student_answers[20] = toupper(student_answers[20]);
student_answers[19] = toupper(student_answers[19]);