Actually, it is:
int main (void)
or
int main (int, char **)
the point where the execution of the program begins
void as function return-type means no return value void as function parameter means no parameter void * as pointer type means generic pointer
The entry point of a C program is the main function.The function signature might be like one of these:1. int main (void)2. int main (int argc, char *argv[])
A function can call other functions (or itself), but a function-definition cannot be nested in another function-definition: int main (void) { void wont_compile (void) { puts ("Won't compile"); } wont_compile (); return 0; }
since, the word 'void' in C programming language means that it does not return any value to the user or calling function....this is usually used to specify a type of function...... for this reason w use 'void'in c program..
Call by reference means calling a function using a reference to a variable or a pointer. You call a function by passing refrences to a variable. For eg: void x(int &a) { a=2; } void main() { int s=3; x(s); } OR void a(int &c) { c=5;}void main(){ int *p; *p=2a(*p);}
No, it should be int type or void.
main() is the function from where the execution starts.
it returns nothing
void as function return-type means no return value void as function parameter means no parameter void * as pointer type means generic pointer
In C-programming: int main (void) { return 0; }
The entry point of a C program is the main function.The function signature might be like one of these:1. int main (void)2. int main (int argc, char *argv[])
Example: int main (void) { puts ("Here is a function definition"); return 0; }
A function can call other functions (or itself), but a function-definition cannot be nested in another function-definition: int main (void) { void wont_compile (void) { puts ("Won't compile"); } wont_compile (); return 0; }
Here is an example:#include int main (void){puts ("Hello, world");return 0;}
example: static void fun (int x) { printf ("x=%d\n", x); } int main (void) { fun (12); return 0; }
Pieces of program-code, they are identified by their names. Example for function-declaration: int main (void); Example for function-definition: int main (void) { puts ("Hello, world!"); return 0; }
since, the word 'void' in C programming language means that it does not return any value to the user or calling function....this is usually used to specify a type of function...... for this reason w use 'void'in c program..