Praveen kumar
Praveen kumar

Reputation: 607

What does "two or more data types in declaration specifiers " error means??

#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

Answers (1)

SLaks
SLaks

Reputation: 887469

typedefs create complete types.

You cannot compose a type out of long and a typedef.

Upvotes: 3

Related Questions