CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 30
  1. #1
    Join Date
    Feb 2007
    Posts
    15

    Angry every single program crashes help me please!!

    I need help everytime i compile the code it says no errrors or anything. All it does is crash sooner than it opens please tell me if anyone has ever had this happen. I use bloodshed dev C++. its driving my a bit insane somone!

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: every single program crashes help me please!!

    Quote Originally Posted by joerules22
    I need help everytime i compile the code it says no errrors or anything.
    You mean like this:
    Code:
    int main()
    {
        char *p = 0;
        *p = 'x';
    }
    All it does is crash sooner than it opens please tell me if anyone has ever had this happen.
    The program above compiles with no errors, and it can crash when you run it.

    So show your code.

    Regards,

    Paul McKenzie

  3. #3
    Join Date
    Feb 2007
    Posts
    15

    Lightbulb Re: every single program crashes help me please!!

    Im just learning c++ this is what i just made and it does the same.

    #include <iostream>
    using namespace std;

    int main ()
    {
    int a;
    int b;
    int result;

    cout << "enter your addition equation";

    result = a + b;

    cout << result;

    return 0;
    }

  4. #4
    Join Date
    Feb 2007
    Posts
    15

    Re: every single program crashes help me please!!

    please help..

  5. #5
    Join Date
    Sep 2006
    Location
    Sunshine State
    Posts
    517

    Re: every single program crashes help me please!!

    Hmm aside from that you didn't initialize your variables, the code is fine.

    Please check your compiler and project settings.

    -Andy

  6. #6
    Join Date
    Feb 2007
    Posts
    15

    Re: every single program crashes help me please!!

    whenever i open any exe that opens in command prompt it crashes... i just found this out... any ideas?

  7. #7
    Join Date
    Sep 2006
    Location
    Sunshine State
    Posts
    517

    Re: every single program crashes help me please!!

    You mean if you start cmd.exe and then open, let's say "calc.exe" ?

    What's your operating system? It is likely that the O/S is at fault here...

  8. #8
    Join Date
    Feb 2007
    Posts
    15

    Re: every single program crashes help me please!!

    it just seems to be programs that i have compiled. Ive downloaded a bunch of soucecode everything i have compiled has crashed. I have another computer and these same programs work. My OS is XP what the hell is going on? ?

  9. #9
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,725

    Re: every single program crashes help me please!!

    What do you mean by "crash" ? What error message gets shown ?

  10. #10
    Join Date
    Feb 2007
    Posts
    15

    Re: every single program crashes help me please!!

    it just comes up for a milisecond and poof is gone.

  11. #11
    Join Date
    Apr 1999
    Posts
    27,449

    Re: every single program crashes help me please!!

    Fix the uninitialized variables and run the program from the command-line.

    Regards,

    Paul McKenzie

  12. #12
    Join Date
    Feb 2007
    Posts
    15

    Re: every single program crashes help me please!!

    EVEN this program wont work!


    #include <iostream>
    using namespace std;

    int main ()
    {
    cout << "Hello World!";
    return 0;
    }

  13. #13
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: every single program crashes help me please!!

    it just comes up for a milisecond and poof is gone.
    IS NOT A CRASH

    If you open a Command Prompt Window (so you get a C:> prompt), navigate to the directory with the .exe, and run the exe from the command line, Wjat Happens?

    ps: The humnan eye is not capable of recognizing something that take only a millisecond. And neither is your computer monitor, so obviously your statement is also wrong.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  14. #14
    Join Date
    Apr 1999
    Posts
    27,449

    Re: every single program crashes help me please!!

    Did you do what I stated? Open a command window, go to where the exe was created, and run it from the command line.

    Do *not* run it by clicking on it in Windows Explorer, or from the Dev-C++ "run" option or anything like that.

    Regards,

    Paul McKenzie

  15. #15
    Join Date
    Apr 1999
    Posts
    27,449

    Re: every single program crashes help me please!!

    Quote Originally Posted by TheCPUWizard
    IS NOT A CRASH

    If you open a Command Prompt Window (so you get a C:> prompt), navigate to the directory with the .exe, and run the exe from the command line, Wjat Happens?
    It's amazing how the simplest thing, i.e. just go to the directory and type in the name of the exe seems to escape so many of these new programmers. I mean, isn't that the way they're taught to run any compiled program?

    Regards,

    Paul McKenzie

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured