I have read it about function and their types in c programming. so after reading I tried to write program for function with no argument and no return type
This is my program ( void function_name (void)
error: void value not ignored as it ought to be
number = delay();
I don't know weather my example is suitable for this reason but I thought it would be best so I just wrote my program. But when I compiled program it's showing error. What's the wrong my idea or program
This is my program ( void function_name (void)
Code:
#include<stdio.h>
void delay (void);
int main (void)
{
int number;
number = delay();
printf(" Print number : %d",number);
return 0;
}
int delay (void)
{
unsigned int i;
for (i = 0; i < 6; i++);
{
}
}
error: void value not ignored as it ought to be
number = delay();
I don't know weather my example is suitable for this reason but I thought it would be best so I just wrote my program. But when I compiled program it's showing error. What's the wrong my idea or program