Quote:
Originally Posted by vol7ron
I like void main() as well.
its endl instead of end1 because the L stands for line. Also you should include the library extension. For instance <iostream.h>
|
There's absolutely no point in using void main(), if you want to be a good developer, stick to standards when possible, especially something as trivial as that. VC might allow it, but gcc in Linux won't. And to prove it, here's the output of using iostream.h, with void main and no return statement on gcc4.
Code:
In file included from /usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/backward/iostream.h:31,
from voidmain.c:1:
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
voidmain.c:5: error: '::main' must return 'int'
The reason you don't put .h after the iostream is because iostream is for C++, not C. All C++ STL's have just the format #include <name>. To include C headers, you leave off the .h and prefix the header with "c". E.g. #include <cstdio>
Quote:
|
Why are you learning C++? It's dated. Move on to C#.
|
C++ is definitely not dead, it may be older than C# but it still has many many uses. KDE is primarily written in C++.
Why use the Unix security system when its dated and Windows is newer?