Re: Convert string to number by Scott
Scott
Sat May 07 08:18:10 CDT 2005
John M wrote:
> What I did before :
>
> #include <stdlib.h>
> #include <string.h>
> #include <dos.h>
> #include <stdio.h>
> #include <conio.h>
> #include "stdafx.h"
>
> and the correction :
> #include "stdafx.h"
> #include <stdlib.h>
> #include <string.h>
> #include <dos.h>
> #include <stdio.h>
> #include <conio.h>
>
> ... and things work fine.
> I don't know why I need to do this (change the "stdafx.h" to its correct
> place), but it took me long time to figure out this problem.
>
> Thanks, anyway :)
stdafx.h represents the implementation of the "precompiled header"
feature. Its purpose is to speed compiles. All those library includes
will be read and compiled every time you compile your program, and they
will be re-read and compiled for every source file that includes them.
This is a terrible burden in a large Windows program, which needs lots
of huge Microsoft headers.
The precompiled header feature works like this: Put all those standard
includes inside stdafx.h, and then include only stdafx.h in your source
files. That eliminates all recompiles of the standard headers. But for
this to work you must put #include "stdafx.h" before any other
compile-able statement in each source file.
--
Scott McPhillips [VC++ MVP]