#include <stdio.h> #include <stdio.h> int main () { printf ("hello world"); return 0; }
when I compile this, the compiler does not give any warnings / errors to turn on stdio.htwice. Why is this so? Are functions now declared and not defined scanf, printfetc.?
stdio.h
scanf
printf
Thanks in advance
Typically, header files are written like the following example to prevent this problem:
#ifndef MYHEADER #define MYHEADER ... #endif
Then, if it is turned on more than once, then the second instance skips the contents.
, , , . :
int foo(int, char *); int foo(int a, char *p); extern int foo(int x, char y[]);
, , , " " , , .
, ; - . () printf scanf , .
, , #ifndef , undefined.
#ifndef
.
, "#ifndef" , (, ).
#ifndef "private", "". , .
, , , , , , , .
, . .
Source: https://habr.com/ru/post/1786829/More articles:CodeBlocks: how to run after creating from a custom makefile - g ++Images in NSImageViews are randomly turned upside down - cocoaWhat to do with lex output? - cRESTful WCF problem (C #,. Net 4) - restHow can I check strings containing ANSI color codes for equivalence in Perl? - terminalWhat is wrong here? (EXC_BAD_ACCESS) - objective-cAuto-Index Generation in C # .Net by Encoding - c #How to speed up INNODB queries comparable to MYISAM metrics? - phpВ JBoss 4.2.3 есть ли способ изменить порядок загрузки/развертывания EARDeployer различных файлов .ear? - java-eeHow to use a modified third-party library in a Rails project? - ruby | fooobar.comAll Articles