What\'s the reason for putting void inside of the params?
Why not just leave it blank?
void createLevel(void);
void createLevel();
In C++ there is no difference.
The following applies only to C:
Actually, according to this thread:
when you declare somewhere a function func(), this means you don't say anything about it's aguments. On the otherhand func(void) means NO ARGUMENTS
perfect_circle even posted a wonderful code example to illustrate the point:
skalkoto@darkstar:~$ cat code.c
#include
int main()
{
void func(void);
func(3);
return 0;
}
void func(int a)
{
printf("Nothing\n");
}
skalkoto@darkstar:~$ gcc code.c
code.c: In function `main':
code.c:6: error: too many arguments to function `func'
skalkoto@darkstar:~$ cat code1.c
#include
int main()
{
void func();
func(3);
return 0;
}
void func(int a)
{
printf("Nothing\n");
}
skalkoto@darkstar:~$ gcc code1.c
skalkoto@darkstar:~$ ./a.out
Nothing
skalkoto@darkstar:~$