Jay J 0 Newbie Poster

I need to be able to use system functions on turbo c++ 3.0 on windows XP. I require this for my school project and I am restricted to this particular compiler and OS (modern OS and old compiler..i love my school :confused: ). Is there anyway in which in i can make this work?? (like a new header file maybe?) :?:

Dani AI

Generated

Turbo C++ 3.0 is a DOS-era, 16‑bit compiler whose runtime expects a real DOS command interpreter. Windows XP (NT kernel) does not provide a native DOS environment — 32‑bit XP uses NTVDM to emulate 16‑bit DOS (limited support) and 64‑bit Windows does not run 16‑bit programs at all. That environment mismatch is the usual reason system() and other DOS-dependent calls behave unpredictably under Turbo on XP.

For the common uses of system() there is a safer, compiler-native approach. Replace shell-dependent calls with Turbo's console routines (from conio.h) and simple input waits instead of invoking the shell. Example:

#include <stdio.h>
#include <conio.h>

int main(void)
{
    clrscr();                       /* clear screen in Turbo */
    printf("Hello, world\n");
    printf("Press any key to continue...");
    getch();                        /* pause without calling the shell */
    return 0;
}

When the code must run external programs or true shell commands, reliable options are: run the compiled EXE from an XP command prompt (on 32‑bit XP), run the IDE/program inside DOSBox (emulates DOS reliably on modern Windows), or use a VM with a 32‑bit Windows/DOS image. If running on a 64‑bit host, DOSBox or a VM is required because native 16‑bit support is absent.

Quick checklist:

  • Include <stdlib.h> before using system().
  • Prefer clrscr()/getch() for cls/pause to avoid shell dependence.
  • If system() must be used, test the same command in an XP cmd window to confirm it exists there.
  • For unavoidable shell-level work, use DOSBox or a VM for the most predictable behavior.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.