Thread: Question about VS 6.0 vs. VS .NET

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    4

    Question about VS 6.0 vs. VS .NET

    I'm working on a simple program for a C++ programming class. He's teaching C++ in Visual Studio 6.0 but I'm using Visual Studio .NET to write my program. Here is what I have so far:

    Code:
    /*	
    	Program Name:	Pgm 12 - Pg 74.cpp
    	Date:		12-19-2003
    */
    
    #include <iostream.h>
    
    int main(void)
    
    {
    	double firstNum = 105.62;
    	double secNum   =  89.352;
    	double thirdNum =  98.67;
    
    	//Display screen setup
    	cout << "First Number:  " << firstNum << endl
    	     << "Second Number: " << secNum   << endl
    	     << "Third Number:  " << thirdNum << endl;
    
    	return 0;
    
    } // end main
    I get an error that says:
    ------ Build started: Project: Pgm 12 - Page 74, Configuration: Debug Win32 ------

    Compiling...
    Pgm 12 - Pg 74.cpp
    Pgm 12 - Pg 74.cpp(29) : fatal error C1010: unexpected end of file while looking for precompiled header directive

    Build log was saved at "file://c:\Documents and Settings\vatterott\My Documents\Visual Studio Projects\Pgm 12 - Page 74\Debug\BuildLog.htm"
    Pgm 12 - Page 74 - 1 error(s), 0 warning(s)


    ---------------------- Done ----------------------

    Build: 0 succeeded, 1 failed, 0 skipped
    What exactly is the difference in the header section for VS 6 vs. .NET?
    Last edited by Guyver03; 12-19-2003 at 01:02 PM.

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Your problem is that you have precompiled headers turned on. right click the project in solution explorer and select properties. Find precompiled headers and turn them off them do a rebuild. all should be fine although i would consider ditching iostream.h in favour of iostream and using std::cout.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Registered User
    Join Date
    Dec 2003
    Posts
    4
    Thanks for the help. I think I have everyting working correctly now.

    As far as the other goes though, I was just used to including all of iostream.h and I keep forgetting about being able to add just what I need. I should really find a way of getting in the habit of that.

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    this is how i think it should look.....
    Code:
    #include <iostream>
    
    using std::cout;
    using std::endl;
    
    int main(void)
    
    {
    	double firstNum = 105.62;
    	double secNum   =  89.352;
    	double thirdNum =  98.67;
    
    	//Display screen setup
    	cout << "First Number:  " << firstNum << endl
    	     << "Second Number: " << secNum   << endl
    	     << "Third Number:  " << thirdNum << endl;
    
    	return 0;
    
    } // end main
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MSVC++ 6.0 Question
    By Eber Kain in forum C++ Programming
    Replies: 1
    Last Post: 10-29-2005, 02:29 PM
  2. Microsoft .NET 2003 Question
    By durban in forum C++ Programming
    Replies: 2
    Last Post: 10-06-2005, 04:28 PM
  3. VS .NET & XP Pro Question
    By hk_mp5kpdw in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-08-2003, 01:07 PM
  4. question on visual c++ (C) 6.0 - help
    By momo20016 in forum C Programming
    Replies: 1
    Last Post: 12-19-2002, 09:13 AM
  5. Port C++ .NET Project back C++ 6.0 :: Visual Studio
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 11-17-2002, 01:11 PM