CrazyEngineers
  • problem in a c program

    accoolaryan

    Member

    Updated: Oct 26, 2024
    Views: 1.9K
    hi
    i want to include a dos command in c program .
    how can i include it so when i run my program so it should run that command?
    😕
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • dipen30

    MemberFeb 1, 2010

    there is a header file in c "dos.h" include that file.
    Are you sure? This action cannot be undone.
    Cancel
  • gaurav.bhorkar

    MemberFeb 1, 2010

    accoolaryan
    hi
    i want to include a dos command in c program .
    how can i include it so when i run my program so it should run that command?
    😕
    If you are using Visual C++ or Dev C++ to compile your programs, then you can use the system () function. Make sure you #include <stdlib.h> in your program.

    Syntax:

    system ("command");
    
    For eg. to clear the screen you can use - system ("cls");
    Are you sure? This action cannot be undone.
    Cancel
  • Manish Goyal

    MemberFeb 1, 2010

    addition to previous post
    Don't forget to use
    #include<stdlib.h>
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register