Tôi đọc từ một cuốn sách về, định nghĩa dự kiến rằng,Về định nghĩa dự kiến
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
Xin giải thích những gì tuyên bố trên có nghĩa. Ngoài ra, sự khác biệt giữa Tuyên bố và Định nghĩa? Tôi bị lẫn lộn vì điều này. :( Và tại sao không chương trình này cung cấp cho một lỗi:
#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");
}
Ngoài ra, những gì là sai với mã này:
#include<stdio.h>
printf("Hi");
int main(void){
return 0;
}
Trong sách bạn đọc về định nghĩa dự kiến? – Destructor