<b>(a)</b> pch.h // Solaris JUST includes this file. #include <iostream.h> <b>(b)</b> pch,cpp // Visual C++ puts the start of this file into the // precompiled header. #define STR1 "Charlie " #include "pch.h" #define STR2 "Daniels" <b>(c)</b> main.cpp #include "pch.h" #ifndef STR1 # define STR1 "James " #endif #ifndef STR2 # define STR2 "Brown" #endif int main() { cout << STR1; cout << STR2; return 0; }
Example 1: This program has different behaviors on NT and UNIX: (a) pch.h; (b) pch.cpp; (c) main.cpp.