error: ‘theachar‘ undeclared (first use in this function); did you mean ‘theacher‘?

The wrong question is not defined

When programming in C language, I encounter error: 'theachar' undeclared (first use in this function); did you mean 'theacher'? Problem.
Look at the following code:

int theacher;
teacher = getStudentScore(pos,student);

As you can see here, a teacher variable is defined above, but a variable that is not defined by teacher is used below. This is obviously wrong, but it is easy to miss this problem in large programs that are densely packed, so for the sake of demonstration, you can pretend not to see it. come out

Generally, the best way to report an error is to go to Youdao Translation Search (Programmer's Guide)
and it says "teachar is not declared". This is already obvious.
Insert image description here

Combining the error line number (23), we can know that a variable on line 23 is mistyped or undefined!
Insert image description here

Find the "teachar" error variable here and correct it!

Guess you like

Origin blog.csdn.net/qq_52749711/article/details/128186741