开发者

Visual C++ 2008 Issues

Okay, this is getting stupid, I have Microsoft Visual Studio 2008, was working fine, now whenever I run a .cpp program my command prompt windows has a default color of gray when I initially had lime green for the output.

Error Message:

'Testing.exe': Loaded 'C:\Users\codebox\Documents\Visual Studio 2008\Projects\Testing\Debug\Testing.exe', Symbols loaded.
'Testing.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll'
'Testing.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll'
'Testing.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll'
'Testing.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcp90d.dll'
'Testing.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.30729.1_none_bb1f6aa1308c35eb\msvcr90d.dll'
The program '[2644] Testing.exe: Native' has exited with code 0 (0x0).

Why is the IDE loading Testing.exe, I just want to test a .cpp?

Code below works fine, except,now i get the above error message, I suspect the IDE:

// This program will assist the High Adventure Travel Agency
// in calculating the costs of their 4 major vacation packages.
#include <iostream>
#include <iomanip>
using namespace std;

// Constants for the charges.
const double CLIMB_RATE = 350.0;       // Base rate - Devil's Courthouse
const double SCUBA_RATE = 1000.0;      // Base rate - Bahamas
const double SKY_DIVE_RATE = 400.0;    // Base rate - Sky diving
// This program is a driver for testing the showFees function.
#include <iostream>
using namespace std;

// Prototype
void showFees(double, int);

int main()
{
   // Constants for membership rates
   const double ADULT = 40.0;
   const double SENIOR = 30.0;
   const double CHILD = 20.0;

   // Perform a test for adult membership.
   cout << "Testing an adult membership...\n"
        << "Calling the showFees function wi开发者_如何学编程th arguments "
        << ADULT << " and 10.\n";
   showFees(ADULT, 10);

   // Perform a test for senior citizen membership.
   cout << "\nTesting a senior citizen membership...\n"
        << "Calling the showFees function with arguments "
        << SENIOR << " and 10.\n";
   showFees(SENIOR, 10);

   // Perform a test for child membership.
   cout << "\nTesting a child membership...\n"
        << "\nCalling the showFees function with arguments "
        << CHILD << " and 10.\n";
   showFees(CHILD, 10);
   return 0;
}

//*****************************************************************
// Definition of function showFees. The memberRate parameter      *
// the monthly membership rate and the months parameter holds the *
// number of months. The function displays the total charges.     *
//*****************************************************************

void showFees(double memberRate, int months)
{
    cout << "The total charges are $"
         << (memberRate * months) << endl;
}

How is a guy suppose to get his/her code on, with this happening? Or what am I suppose to change, I just want to code in C++ and test my code that's all, not mess around with the damn IDE.

Solution: Ctrl+5

http://msdn.microsoft.com/en-us/library/ms235629.aspx

To build and examine the program

1.

  On the Build menu, click Build Solution.

  The Output window displays information about the compilation

progress, for example, the location of the build log and a message that states the build status. 2.

  On the Debug menu, click Start without Debugging.

  If you used the sample program, a command window is displayed and

shows whether certain integers are found in the set.


There's no error... the messages you reported are just VC++ notifying you about which dlls are loaded, which debug symbols are available, etc. The last line tells you that the program terminated with return code 0. If you don't see your program running it's just because it's very fast, and at its end the console automatically closes.

To see the output of your program you have many options: you may set a breakpoint on the return 0 (so the program is paused there, and you can have a look at the console window before it closes), or you may start the program without debugging (in that case VC++ asks you to press a key before ending the program); you could also add the lines

cout<<"Press Enter to exit.";
cin.sync();
cin.ignore();

before the return 0: in this way the key press before exit will be included in the application (I don't recommend this approach, though, because if you want to run the program from an already opened console you end up having always that annoying message at the end of the application).

By the way, this question may hold the record of "most asked question" about VC++ and many other IDEs :)

Why is the IDE loading Testing.exe, I just want to test a .cpp?

You know... to run a .cpp you must compile it first... and what do you get from a compilation? A .exe... >_>

I just want to code in C++ and test my code that's all, not mess around with the damn IDE.

When you'll have to debug a big application you'll bless that "damn IDE".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜