如何在命令提示符下运行.exe文件? [英] How to run a .exe file with command prompt?

查看:362
本文介绍了如何在命令提示符下运行.exe文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做在线法官.这是我的学校项目.

I am making an online judge. This my school project.

我正在从用户那里获取一个.c文件.我可以在命令提示符下编译.c文件.但是我不知道如何运行该文件.我需要运行此文件,从文本文件获取输入,然后将输出保存在文本文件中.编译代码为:

I am taking a .c file from the user. I am able to compile the .c file with command prompt. But I don't know how to run this file. I need to run this file, take input from a text file and save output in a text file. The compilation code was:

    gcc main.c -o HelloWorld

推荐答案

我需要运行此文件,从文本文件获取输入并保存输出 在文本文件中.

I need to run this file, take input from a text file and save output in a text file.

假设您使用的是Linux,这应该可以:

Assuming you're on Linux, this should work:

./HelloWorld < input.txt > output.txt

这篇关于如何在命令提示符下运行.exe文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆