//main.cpp
int puts ( constchar * str );
int main()
{
puts("Hello world\n");
}
HI guys,
The above won't work in g++. But some one i know says it works in other compilers.
puts() is a function in C standard library.
So is there any option i have to use in order to make it work?
Thank you very much.
If it is in the C std library, then you shouldn't be declaring your own prototype. Considering there are no multiple definition errors, I think you are not including <stdio.h> (for C) or <cstdio> (for C++).
You are not linking against the C++ runtime library for some reason. Don't know why your compiler is not including it by default. The code is otherwise correct and compiles and runs fine for me.