I came across this piece of code on a website.
main(i)
{
gets(&i);
puts();
}
This code compiles and runs fine!
It gets a string as input from the user and prints it!!!!
But, my question is, how?
(note that puts() function does not contain any arguments!)
Old versions of C had implicit types for variables and functions, and this code makes use of that and some other stuff. It also was very lax about actually returning values.