Sun C++ 4.0 has been obolete since 1996. It is not possible to get that version now. In any event, it doesn't work on Linux.
A pre-release version of Sun C++ for Linux is available via the Sun Studio Express program. The compiler and tool set are free. You can get them here:
http://developers.sun.com/prodtech/cc/downloads/express.jsp
You can find general information on Sun Studio (which includes the C++ compiler) here:
http://developers.sun.com/sunstudio/
The current release, Sun Studio 11, is free.