compile failure past anything except extremely simple code

I recently downloaded and installed "Visual Studio C++ 8: Express Edition Beta 2", in order to learn C++ (I know Java). After installing, during which everything appeared to work as intended, I created a shortcut to the command prompt located in the start-menu\visual C++ studio\ directory.

When I attempt to compile the following:
--
#include "stdafx.h"

...
--
it returns "fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory".
The only code the compiler has successfuly compiled, and was able to run, during my attempts was:
--
int main() {
return 0;
}
--
so I assume that the C++ language installed at least in part.
Also, what exactly is the #include "stdafx.h"?

[752 byte] By [forum389] at [2007-12-16]
# 1
The command prompt access to the tools doesn't include all the setting that the wizard does.

You have to create the header file your self.

Yo know more about stdafx.h, please see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcurfprecompiledheaderfiles.asp

Header files in general and #include:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_predir_The_.23.include_Directive.asp

Thanks,
Ayman Shoukry
VC++

AymanShoukry at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ General...
# 2

The IDE for Visual Studios returns the same problems, except it states "cannot locate precompiled header file".

Also, as to "create your own header file", is it not possible to use the system header files? I tried to locate stdafx.h but was could not find it.

What is a decent header file to use for outputing and testing simple code (command prompt output, numeric operations, etc)?

Why does the IDE (or, those that coded it) assert that a "solution" and a "project" are necessary?

forum389 at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ General...
# 3

There is nothing that constitutes a system header file. stdafx.h is basically a header file that the Wizard uses to include other files or macros that migh be needed. So you won't find such a file except if create certain type of projects.

Here is a sample for prompt output:

//test.cpp
#include <stdio.h>
void main()
{
printf ("Test");
}

compilation command --> cl test.cpp
then run test.exe

Thanks,
Ayman Shoukry
VC++

AymanShoukry at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ General...
# 4
it worked
forum389 at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ General...