Dev-C++ 4 woes

This is a discussion on Dev-C++ 4 woes within the C++ Programming forums, part of the General Programming Boards category; Alright, i've got a project with headers and such written by me that i'd like to compile and run. When ...

  1. #1
    Aran
    Guest

    Dev-C++ 4 woes

    Alright, i've got a project with headers and such written by me that i'd like to compile and run. When i compile the project i get 0 errors, yet when i run it, a console window pops up and immediately destroys itself even though there are sections of user input.

    Please give me some idea of what the problem is and how to fix it.

  2. #2
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Use the system("PAUSE"); command*type just like that, with the ( ), " ", and the ;* Just before the return 0;.

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Use the system("PAUSE"); command
    He said that the program takes user input, so if it's not stopping for that then system ( "PAUSE" ); won't help much. I've never used Dev C++, but it should have some kind of debugger that lets you step through code. You can find what is causing the problem that way.

    -Prelude
    My best code is written with the delete key.

  4. #4
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Dev-C++ has a debugger, and this is what I mean:
    Code:
    #include <iostream.h>
    #include "anyheadersyouwant.h"
    
    char name[20];
    
    int main()
    { 
       cout << "Hi there!\n"
                     "Please tell me your name:\n";
       cin >> name;
       cout << "Thank You "<<name<<".  Please come again.\n";
       system("PAUSE");
       return 0;
    }

  5. #5
    Aran
    Guest
    i figured out the problem.. i just hadn't set the include directory properly and it was using a different main.cpp file as the main file... strange, but it's fine now.

    thanks for trying to help everyone.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New to Dev C++/<windows.h>...
    By Cilius in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2005, 01:05 AM
  2. Glut and Dev C++, Programs not Quitting?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-29-2004, 08:43 PM
  3. openGL programming - From MSVC++ to Dev C++
    By WDT in forum Game Programming
    Replies: 1
    Last Post: 03-08-2004, 05:19 PM
  4. DEV C++ Limitations?
    By Kirdra in forum Game Programming
    Replies: 3
    Last Post: 09-09-2002, 10:40 PM
  5. Tutorial about Bloodshed Dev!
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 11-13-2001, 07:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21