yeap
If yes, they're the same
why cpp has to do to things for the same thing ??
Idk. Maybe you can find something on cpp annotations. Google it. This topic is right on the beginning
Until C23, in C C fun(void) and fun() are slightly different, fun() means the function can take arbitary no of parameters. while fun(void) will not take any. From C23 onwards f() and f(void) are the same. In C++ for backwards compatibility fun(void) is allowed but it's the same as fun()
cool , i tried to pass a variable to a non paramter function like that : int func() { printf("%d" , x ) ; ) int main() { int x = 1 ; func(x) ; } it didn't work tho
https://godbolt.org/z/fvvT5qsf4
you did not define func(), you've only declared it
as i know , the int func ; in the beggining is only required if you declare the function after the main function
here it's before it
uhh what? if you separate declaration from definition, you need to provide definition, or resolve it at link time
not sure what this mean : so this is declaration : int func() { //some code } and this is definitions : int func() ;
Обсуждают сегодня