Reputation: 1235
I am trying below simple example by using inline functions in C language. Its giving me a compilation error(on inline function) as shown below.
Error test.c 1: Declaration Syntax Error
My C code is as shown below
inline int square(int a)
{
return(a*a);
}
void main()
{
int no,result;
clrscr();
printf("\nEnter the number ");
scanf("%d",&no);
result=square(no);
printf("\n Square is %d ",result);
getch();
}
Upvotes: 0
Views: 284
Reputation: 155708
I am using Turbo C++ 3.2
There's your problem:
inline
keyword was added to C in C99.Solution:
Upvotes: 4