Thread: DOS Program

  1. #1
    Unregistered
    Guest

    DOS Program

    Hey, I've written my program it does what I want it to do. Until I try and run it in dos. Then I get this irratating message "this program cannot run in dos." My question is, is there anyway to write a dos program using VC++ 6.0.

    Any help is appreciated
    Jon
    [email protected]

  2. #2
    looking for the truth moemen ahmed's Avatar
    Join Date
    Feb 2002
    Location
    Egypt
    Posts
    161
    sure you can make a DOS program in Visual C++
    you can make new project (you should choose win32 console application)
    console program is suitable for DOS envirnment.

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    32

    re dos program

    if you have the right compiler... i think borland had a strictly dos compiler it was something like version 3 or 3.3 somthing like that. but then again Dev-C++ is a good compiler and if you create a new project it will ask

    create new... Windows , Dos , Win32 , Dll , or empty project

    you should select eother DOS or WIN32 they both should be compatible with you "project" and if WIN32 isnt DOS should work no q's asked if you dont have DEV-C++ get it HERE

  4. #4
    DJGPP is extremely excellent DOS only compiler. You can get it at www.delorie.com

    I've only had one problem with DJGPP. The assembly isn't the standard assembly code. It's a weird type. There is a link to a regular to weird chart somewhere in the boards. It is either AT&T is regular or IBM is, I don't remember.

    If you want to use graphics in DJGPP, a good site to go to is www.brackeen.com

  5. #5
    Unregistered
    Guest
    I've tried a win32 console app in VC++. Still got the message "this program cannot run in DOS mode". I downloaded DevC++ and can't get my program to compile without errors. It compiled free of errors in VC++.

    Any help is appreciated
    Jon
    [email protected]

  6. #6
    Unregistered
    Guest

    ...

    post your code

  7. #7
    Unregistered
    Guest
    Okay guys here is the code. I found it elsewhere on this board, and modified it to fit my needs.

    #include<iostream>
    #include<conio.h>

    using namespace std;

    void GetPassword( char* entry );

    void main( void )
    {

    char password[10] = "admin";
    char entry[10] = "";

    do{

    cout << "\nEnter password: " << flush;


    GetPassword( entry );

    }while(strcmp(entry, password));

    }

    void GetPassword( char *entry )
    {
    int i = 0;
    char ch;

    while( 1 )
    {
    while( !kbhit() ); //** pause until kentered

    ch = entry[ i++ ] = (char)getch();

    putchar( '*' );

    if( ch == 13 ) //does not like '\n or '\0'
    {
    entry[i-1] = '\0';
    break;
    }
    else if( i == 9 )
    {
    entry[i] = '\0';
    break;
    }
    }
    }


    Any help is appreciated
    Jon
    [email protected]

  8. #8
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    My question is, is there anyway to write a dos program using VC++ 6.0.
    NO
    You need a DOS compiler. Try DJGPP
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Client-server system with input from separate program
    By robot-ic in forum Networking/Device Communication
    Replies: 3
    Last Post: 01-16-2009, 03:30 PM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  4. Compiling a program in VC++ and run it in DOS
    By Willhunting in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 01-18-2003, 04:09 AM
  5. initialising a DOS program from a C enviroment
    By Robert_Ingleby in forum C Programming
    Replies: 5
    Last Post: 03-07-2002, 01:53 PM