KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Here I have written my name in main argument declaration but still this program works and did not give any warning. #include <stdio.h> int main(Mr32) { printf("why this works?"); return 0; } Whenever I write anything in place of mr32 , The code still works. I really don't know why this is happening. As per C programming standard this is wrong, right? Edit : I have tried -Wall but it does not give any warning. I think here it should be error, because i am not doing as standard C function definition declaration In c every function definition must follow this format return-type function_name ( arg_type arg1, ..., arg_type argN ); This should also appy to main() right ..?? Okay -Wextra shows warning that mr32 is by default int. Then why is the default type of any argument in main() an int?
Tags (comma-separated)
Save Edits
Cancel