I have Microsoft Visual C++ 2010. I was given code and said and copy and run. I do this: I go to the program – & gt; Create project – & gt; Console application Win32 (as explained). I copy the code and click F7 kbd>and that's what it writes:
1 & gt; ------ Building started: Project: 234, Configuration: Debug Win32 ------
1 & gt; stdafx.cpp.
1 & gt; 234.CPP.
1 & gt; c: \ users \ Sasha \ desktop \ 234 \ 234 \ 234.cpp (1): Warning C4627: #include & lt; math.h & gt ;: missed when searching for using a precompiled title
1 & gt; Adding a directive in "stdafx.h" or reorganization of a precompiled header
1 & gt; C: \ Users \ Sasha \ Desktop \ 234 \ 234 \ 234.cpp (33): Fatal Error C1010: an unforeseen end of the file during the search for a pre-compiled header. You may have forgotten adding the directive "#Include" stdafx.h "" to the source.
Building: Successful: 0, with errors: 1, No change: 0, Missed: 0
Code itself:
# include & lt; math.h & gt;
const float left = 0, right = 4, tabul = 0.1;
Float FUN1 (Float Farg)
{
FLOAT FTEMP = 0;
int ni;
for (ni = 1; ni & lt; = 5; ni = ni + 1)
FTEMP = FTEMP + SQRT ((Farg + Ni) / Ni);
RETURN FTEMP;
}
Float FUN2 (Float Farg)
{
Float ftemp = log (2 * Farg * Farg) + 3 * sin (Farg);
RETURN FTEMP;
}
Void Main ()
{
Float FX = Left;
Float FY;
While (FX & LT; = RIGHT) {
if (FX & LT; = 2)
FY = FUN1 (FX);
ELSE.
FY = FUN2 (FX);
FX = FX + Tabul;
}
}
Answer 1, Authority 100%
1 & gt; stdafx.cpp already on this line it is clear that the project incorrectly created!
Need:
file- & gt; Create project- & gt; Console application Win32
Next to populate this picture
http://s59.radikal.ru/i165/1209/b1/b1ba1cc58e75.jpg
Next
http://s003.radikal.ru/i203/1209/06/ac4c4c414aeb.jpg
Next
http://i068.radikal.ru/1209/ea/ac4087d7b8f5.jpg
At the end we get the running and normally spent program ...
http://i037.radikal.ru/1209/d9/550b21c56933.jpg
Answer 2
You can still try in the project settings Disable Precompiled Headers