Home > Back-end >  C language header file can't find the variable type
C language header file can't find the variable type

Time:09-17

Why in the main function wrote a typedef int PON, and then write a header file, the header file PON types in not?

CodePudding user response:

The typedef int PON. In shishi. H file to
Typedef int PON. In the main. C, shishi. H PON are invisible, so don't know what PON types,
In shishi. H file shishi. H knew what PON is, and the main. In the c # include "shishi. H" after the main will know all of this information

CodePudding user response:

reference 1st floor qybao response:
the typedef int PON. In shishi. H file to
Typedef int PON. In the main. C, shishi. H PON are invisible, so don't know what PON types,
In shishi. H file shishi. H knew what PON is, and the main. In the c # include "shishi. H" after the main will know all of this information

Write typedef int PON and reference headers shishi. H such shishi. H why undetectable in it

CodePudding user response:

Because your shishi. H won't go to # include ". The main c "(typically have this kind of practice), which files have any information, other file does not include it wouldn't know the file information, just like your friends have 10 dollars, you include your friends, you can see him 10 yuan, otherwise, he knows how much money you can't, files, as well the include is equivalent to the other file information to add to the current file,

CodePudding user response:

reference fat beef ^ * ^ 2 floor response:
Quote: refer to 1st floor qybao response:
the typedef int PON. In shishi. H file to
Typedef int PON. In the main. C, shishi. H PON are invisible, so don't know what PON types,
In shishi. H file shishi. H knew what PON is, and the main. In the c # include "shishi. H" after the main will know all of this information

Write typedef int PON and reference headers shishi. H such shishi. Why h inside is undetectable

After you put in a header file and put in the header file include to shishi. H file, it is introduced in the header file header, namely in shishi. H plus a # include in "" the double quotation marks is to define the PON,
  • Related