Reputation: 607
#include <stdio.h>
typedef int nt;
void main () {
long int k;
}
When I run the above code in gcc, it didn't show any error. But when I run the below code, it threw an error message "two or more data types in declaration specifiers ".
#include <stdio.h>
typedef int nt;
void main () {
long nt k;
}
Could anyone explain me what is this error all about??
Upvotes: 0
Views: 5458
Reputation: 887469
typedef
s create complete types.
You cannot compose a type out of long
and a typedef.
Upvotes: 3