c language calls DOS commands, and how c language command line programs are compiled and run under D

Updated on technology 2024-03-18
8 answers
  1. Anonymous users2024-02-06

    system("command");The role is to open the "Command Prompt", and later you can manually enter DOS commands.

    system("dir");Print the current directory in C.

    See below for details

    The int system(const char *s) system function passes the string s to the system environment for running. If s is null, if there is a command handler system that returns a non-0. If s is non-null, the value returned by system is related to the environment in which it is executed.

  2. Anonymous users2024-02-05

    The masters upstairs made it very clear.

    Include include

    It's system(const char*);

    For example, system("color 0a"This is to set the output text to be green and the background to be black.

    system("pause"Press any key to continue.

    system("del ") to delete the file.

  3. Anonymous users2024-02-04

    Click the computer start menu, open the run window, enter cmd in the window box, click the OK button, and open the cmd command.

    window, then go to the executable folder in your project directory and enter the executable file name followed by the parameters you need Press enter and you can cmd command: if your executable is in d: cp debug you need to type d: in the command line window

    Press the Enter key to enter the CD CP Debug on the D drive, and press the Enter key to enter the CD directory and the Debug subdirectory on the D drive.

    Type 2 3 and press Enter to run your program, and the result will appear to the power = 8

  4. Anonymous users2024-02-03

    Start >> Run >> cmd enter.

    In the cmd interface, go to the debug directory of your project, (assuming you make the program is, and then enter it.)

    xx 2 3

    Your program returns.

    to the power = 8 plus a graph.

  5. Anonymous users2024-02-02

    Enter 11 12 number exponent in the debug directory and press enter!

  6. Anonymous users2024-02-01

    Compile and run a C program in the console, the C compiler on Windows is GCC, and the C compiler on Linux is GCC.

    In the command prompt, execute CL is the C language source code file). The following diagram shows who compiled with the CL compiler and executed the generated program.

  7. Anonymous users2024-01-31

    Not finding the program is a problem with the path.

    You can run it directly in Visual Studio Command Prompt.

    Or open cmd and execute it in the vc directory.

  8. Anonymous users2024-01-30

    There is a system function to call the dos command, and the file operation is fopen file and so on.

Related questions
13 answers2024-03-18

Stack errors are usually used because of a function called cdecl with stdcall. >>>More

12 answers2024-03-18

The C language is used to develop programs, and the so-called DOS language is just a series of commands based on Windows. >>>More

16 answers2024-03-18

Definition of a for loop.

for(the initial value of the variable; termination of operating conditions; The initial value of the first cycle i is 0, and it runs until i=3 stops i=2, and the condition is still satisfied, and the loop body is still executed, and the step size is 1+1 each time >>>More

9 answers2024-03-18

Hey! This is a very simple function to write, Your Excellency is estimated to have just learned data structures, now learn sorting, lookup, it's easy to give me a reward of two hundred points, I'll help you write it right away. >>>More

7 answers2024-03-18

It's called the [batch] program, in fact, don't think that the program you mentioned above to deal with garbage is really powerful, it's amazing, when you have learned DOS, that program can be said to be a very simple thing; >>>More