Source information stripped?

I just started to learn about C++, but my professor hasn't said anything about getting an error like mines. I'm trying to run it on Visual Studio 2010 Express and my program runs until a certain point then crashes, and I received this error message. I tried asking for help from people I know, but they say that my coding is correct and didn't know how to help me.

1
2
3
4
5
6
'Linh.exe': Loaded 'C:\Users\Houng\Documents\Visual Studio 2010\Projects\Linh\Debug\Linh.exe', Symbols loaded.
'Linh.exe': Loaded 'C:\Windows\System32\ntdll.dll', Symbols loaded (source information stripped).
'Linh.exe': Loaded 'C:\Windows\System32\kernel32.dll', Symbols loaded (source information stripped).
'Linh.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
'Linh.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
The program '[7988] Linh.exe: Native' has exited with code 0 (0x0).
'Linh.exe': Loaded 'C:\Users\Houng\Documents\Visual Studio 2010\Projects\Linh\Debug\Linh.exe', Symbols loaded.
'Linh.exe': Loaded 'C:\Windows\System32\ntdll.dll', Symbols loaded (source information stripped).
'Linh.exe': Loaded 'C:\Windows\System32\kernel32.dll', Symbols loaded (source information stripped).
'Linh.exe': Loaded 'C:\Windows\System32\msvcp100d.dll', Symbols loaded.
'Linh.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
The program '[7988] Linh.exe: Native' has exited with code 0 (0x0).


These are not errors. The first five are informational messages generated by the debugger. The last informational messages says that your program has finished execution and has ended normally.
Last edited on
But then why does my program crash halfway through? This is the code I am using, but then it stops right after I put in the amount of item5.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// This program asks the user to enter the amount of each item bought, so
// that the user will know the total amount. It will do so by adding the items
// to get the subtotal, then by multiplying by the sales tax. Then the total
// will be displayed on the screen.
#include <iostream>
using namespace std;

int main()
{
    double item1, item2, item3, item4, item5, subtotal, tax, total;

    cout << "This program will help you know the total amount of ";
    cout << "money when purchasing your  five items. " << endl ;
    
    // Getting how much each item cost.
    cout << "How much did item 1 cost? ";
    cin >> item1;

    cout << "How much did item 2 cost? ";
    cin >> item2;

    cout << "How much did item 3 cost? ";
    cin >> item3;

    cout << "How much did item 4 cost? ";
    cin >> item4;

    cout << "How much did item 5 cost? ";
    cin >> item5;

    // Calculate subtotal.
	subtotal = item1 + item2 + item3 + item4 + item5;

    // Display the subtotal.
    cout << "The amount so far is $ " << subtotal << ".\n";
    
    // Display total with sales tax.
	tax = .06;
    total = subtotal * (1 + tax);

    cout << "Your total with the 6% sales tax is $ " << total << endl;
    return 0;
}
Last edited on
Can't see why that would stop. You haven't accidentally but a break point somewhere, have you?
It's not crashing. It's finishing. When it is finished, it closes the window that it had to open to run.

http://www.cplusplus.com/forum/beginner/1988/
Thank you very much Moschops. I went to the link you put in, and then I added a system("pause") after my last cout and it works perfectly.
> But then why does my program crash halfway through?

It doesn't crash halfway through. It just finishes before you have had the time to read the output.

Add these two line at the end (just before return 0 ;) to make the program wait for an input.

1
2
std::cout << "enter any char to quit " ; 
char c ; std::cin >> std::skipws >> c ;
closed account (z05DSL3A)
Try going to the debug menu and selecting start without debugging.
I went to the link you put in, and then I added a system("pause")


That's the exact thing listed there as what not to do. I should have said this one instead :(
http://www.cplusplus.com/articles/iw6AC542/
Last edited on
> I added a system("pause") after my last cout and it works perfectly.

Avoid constructs like system("pause") if possible. The reason is something that you may not want to worry about right now (very briefly, it creates a vulnerability in your code which can be subject to an exploit); and it is probably not relevant in this particular case. But it does not make sense to get into bad habits right now; it is surprisingly difficult to unlearn wrong things that you have already learned.
Although it says not to do that, my Professor specifically said he didn't want anything in our coding that hasn't been taught to us. Since it's our first homework assignment I kind of thought just adding the (1 + tax) was pushing my luck. Since he has talked about the system("pause") before, I thought it would be okay to use it.

But thanks a lot for all of your help guys :]
You could indicate that since its a console program, it should be run from the console.
You could indicate that since its a console program, it should be run from the console.


I'm not too sure, but I would try to learn the other way rather than using the system("pause").

And I tried putting in
1
2
 std::cout << "enter any char to quit " ; 
char c ; std::cin >> std::skipws >> c ;
and it works too, but I don't really understand what each of those symbols do.
hi,
i am also new and getting really confused.
is there a way to change the settings of the vc 2010 express such that the console will remain open until a key is pressed??

i am getting these messages curently and the console disappears almost immediately after it appears

'hallo.exe': Loaded 'C:\Users\Documents\Visual Studio 2010\Projects\hallo\Debug\hallo.exe', Symbols loaded.
'hallo.exe': Loaded 'C:\Windows\System32\ntdll.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\kernel32.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
'hallo.exe': Loaded 'C:\Windows\System32\apphelp.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\AppPatch\AcLayers.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\sspicli.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\user32.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\gdi32.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\lpk.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\usp10.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\shell32.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\ole32.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\userenv.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\profapi.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\winspool.drv', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\mpr.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\AppPatch\AcGenral.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\sechost.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\uxtheme.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\winmm.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\samcli.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\msacm32.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\advapi32.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\version.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\sfc.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\sfc_os.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\dwmapi.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\setupapi.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\cfgmgr32.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\devobj.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\urlmon.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\wininet.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\iertutil.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\crypt32.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\msasn1.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\AppPatch\AcXtrnal.dll', Symbols loaded (source information stripped).
FTH: (4944): *** Fault tolerant heap shim applied to current process. This is usually due to previous crashes. ***
'hallo.exe': Loaded 'ImageAtBase0x190000', Loading disabled by Include/Exclude setting.
'hallo.exe': Unloaded 'ImageAtBase0x190000'
'hallo.exe': Loaded 'C:\Windows\System32\shunimpl.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\SortWindows6Compat.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\imm32.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\msctf.dll', Symbols loaded (source information stripped).
'hallo.exe': Loaded 'C:\Windows\System32\psapi.dll', Symbols loaded (source information stripped).
The program '[4944] hallo.exe: Native' has exited with code 0 (0x0).

help pls!
All you needed to do is run the program with the debugger on. >_>

-Albatross
The solution is exactly the reverse :)

Do not use the debugger and Visual Studio will keep the console window open.
closed account (z05DSL3A)
Albatross wrote:
All you needed to do is run the program with the debugger on. >_>

[sobbing]No, Running with the debugger on will treat the program as if you double clicked the icon in explorer, a console window will open the program will run and at the end the window will close.[/sobbing]

greenyo,
http://www.cplusplus.com/forum/beginner/61190/#msg330909
Topic archived. No new replies allowed.