cLanguage identifier is not defined

Asked 1 weeks ago, Updated 1 weeks ago, 1 views

I'm learning C language after watching your YouTube video, but I wrote the same code in the middle, but I keep getting errors. We debugged it and it says that the undeclared identifier i was used in line 7 Didn't you already declare i in the for statement? At first, I thought it was an error, so I turned it off and on a few times, but it keeps doing this.

c

2022-09-20 11:36

2 Answers

Please upload the code in text.

The problem seems to be caused by the wrong semicolon attached at the end of the for door line.


2022-09-20 11:36

#include <stdio.h>

int main(void) {
  for (int i = 0; i <= 30; ++i) {
    printf("%d student, prepare for the group presentation"\n", i);
  }
  return 0;
}

If you run the same thing, it will work normally without any problems. Press Run code above. [del] First of all, there seems to be no problem with grammar.

If you make a few guesses, I think you need to find out what the extension of the file.

You need to check if or i is really the alphabet i. Even if it appears to be an alphabet i in the human eye, there is a character code other than i in the character code. There are also " on the same line, so it is necessary to make sure that you typed it properly, and for this, you need to put a code in the question, not a picture.

Please use ``` to paste the code.


2022-09-20 11:36

If you have any answers or tips


© 2022 pinfo. All rights reserved.