1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

C++ Error Help!

Discussion in 'C++' started by michael j g, Jul 27, 2011.

  1. michael j g

    michael j g New Member

    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?
     
  2. Darker

    Darker New Member

    I am newbie too, but shouldn't the app end with return 0 to prove that no errors occured during runtime?
     
  3. xpi0t0s

    xpi0t0s Mentor

    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.)
     
  4. michael j g

    michael j g New Member

    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!)
     

Share This Page