Czytam z książki o wstępną defination żeO Wstępna definicja
A tentative definition is any external data declaration that has no storage class specifier and no initializer. A tentative definition becomes a full definition if the end of the translation unit is reached and no definition has appeared with an initializer for the identifier
Proszę wyjaśnić, co oznacza, że powyższe stwierdzenie. Różnica między deklaracją a definicją? Z tego powodu się pomyliłem. :( A dlaczego nie ten program daje błąd:
#include<stdio.h>
int a; //Tentative definition
int a; //similarly this declaration too.
int main() //not getting any error with this code why its so?
{
printf("hi");
}
Ponadto, co jest nie tak z tym kodem:
#include<stdio.h>
printf("Hi");
int main(void){
return 0;
}
W której książce przeczytasz o wstępnej definicji? – Destructor