Some common errors in c language

  1. VS2017 scanf is not available
    #define _CRT_SECURE_NO_WARNINGS is placed at the beginning of the c file
    Insert picture description here
  2. Compile link error
    Insert picture description here
    with wrong function name. If you have this prompt to compile, click No
  3. Variable redefinition, function name redefinition error
    Insert picture description here
  4. There can be multiple c files in a project, but only one main function
    (1) If there are multiple .c files, a header file must be created and function declarations must be made. Put the header files of other .c files into your own .h header file
    (2) Add your own defined header files to all .c files (" "means to search from the current directory)
    Insert picture description here
    Insert picture description here
  5. Try not to use global variables,
    because if global variables and local variables have the same name, problems will occur
  6. The structure type and the structure variable name are the same, which will cause a space application error,
    otherwise it will cause the access out of bounds

Guess you like

Origin blog.csdn.net/weixin_43722052/article/details/113796163