Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   C++ Error Help! (http://www.go4expert.com/forums/cpp-error-help-t26380/)

michael j g 27Jul2011 15:48

C++ Error Help!
 
I have made a program in C++ and it is not working properly.

My code:
Code:

#include <iostream>
#include <string>
using namespace std;
int main()
{
string A = "";
cout << "Enter anything at all to next sentece ETC Name: ";
cin >> A;
cout << endl;
cout << "You said: " << A << endl << endl;
}

Their is not errors as the compiler says their is one Succeeded.
The error is Randomizing with numbers.

The log of the Lanch:
'Techno mechonisems 1.exe': Loaded 'C:\Users\Michael\Documents\Visual Studio 2010\Projects\Techno mechonisems 1\Release\Techno mechonisems 1.exe', Symbols loaded.
'Techno mechonisems 1.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'Techno mechonisems 1.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'Techno mechonisems 1.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'Techno mechonisems 1.exe': Loaded 'C:\Windows\SysWOW64\msvcp100.dll', Symbols loaded.
'Techno mechonisems 1.exe': Loaded 'C:\Windows\SysWOW64\msvcr100.dll', Symbols loaded.
The program '[1584] Techno mechonisems 1.exe: Native' has exited with code 0 (0x0).

Their is only one thing that is not right.
The program in c++ 2010 on Windows 7 Keeps closeing with out showing the following Message.
I have Used c++ on another Hard drive and works fine.
The code works.
What is wrong with the code and the program?


I am only learning, and have not coded for a long time. But i can understand a lotta my misstakes.

Please Can Anyone Help me?

Darker 27Jul2011 19:01

Re: C++ Error Help!
 
I am newbie too, but shouldn't the app end with return 0 to prove that no errors occured during runtime?

xpi0t0s 29Jul2011 02:41

Re: C++ Error Help!
 
How exactly is it not working properly? Could you give an example output explaining what you saw and what you expected? I use VS2010 too so I ran the program and got the following:

Enter anything at all to next sentece ETC Name: hello world
You said: hello

Which is exactly what I would expect. Is that what you mean by "not working properly"?

Darker: no, the only point of a return code from main is to indicate the status of the program to the caller (typically the shell) and it's a good idea just to return 0; on the grounds that sooner or later you might want to detect whether or not there was a runtime error. If you don't have a return statement at the end of main it will still return, but with an unspecified value (on the x86 compilers I've seen, that is the value in EAX.)

michael j g 4Aug2011 17:49

Re: C++ Error Help!
 
I found out that their was not problem with the Program working it was me not Registering the Product after Instaling.

Sorry for the Fidle.

Open Close = "Cause of Debug When sould Be Start Without Debuging"

Makeing New Fourm with a thing that i will need help with which is new Project.

Console Via Internet/LAN.

BETA 0.1.

Chating with Friends.

Progect: Test Chat in Beta (Not Built Yet!)


All times are GMT +5.5. The time now is 07:27.