在DOS下编写并运行C程序 :sanqima
https://blog.csdn.net/sanqima/article/details/7473078
1)“开始”--“运行”--cmd---回车,进入DOS界面,
C:\Documents and Settings\Administrator>cd C:\Documents and Settings\Administrat
or\桌面
2)先创建一个C程序,命名为cyuyan.c,如下:
C:\Documents and Settings\Administrator\桌面>copy con cyuyan.c
#include<stdio.c>
void main()
{
printf("Hello World!");
}
^Z
已复制 1 个文件。
C:\Documents and Settings\Administrator\桌面>type cyuyan.c
#include<stdio.c>
void main()
{
printf("Hello World!");
}
注意:^Z表示使用Ctrl+Z快捷键,来终止文件的写入。
3)对cyuyan.c文件进行编译,使用cl cyuyan.c命令,如下:
C:\Documents and Settings\Administrator\桌面>cl cyuyan.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
cyuyan.c
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:cyuyan.exe
cyuyan.obj
4)最后,执行cyuyan.c程序,输入cyuyan.exe即可,如下:
C:\Documents and Settings\Administrator\桌面>cyuyan.exe
Hello World!
C:\Documents and Settings\Administrator\桌面>
------------------------------------------------------------------------------------------
按照说明,好像执行不成功,是需要安装什么吗?
DOS 使用CL命令 编译程序
https://blog.csdn.net/guchaono1/article/details/71438999
_花谢花飞飞_ cl.exe (cl.zip应该是32位)
http://vdisk.weibo.com/u/2063062242
微软 CL.exe 编译器 :冰森 (对cl.exe的解说比较好)
https://lellansin.wordpress.com/2013/06/11/%E5%BE%AE%E8%BD%AF-cl-exe-%E7%BC%96%E8%AF%91%E5%99%A8/
C语言编译器CL.exe :veis (cl.7z=64位)
https://www.cnblogs.com/veis/p/6940930.html
Last edited by zzz19760225 on 2018-4-9 at 12:06 ]
Writing and running a C program under DOS :sanqima
https://blog.csdn.net/sanqima/article/details/7473078
1) "Start" -- "Run" -- cmd -- Enter, enter the DOS interface,
C:\Documents and Settings\Administrator>cd C:\Documents and Settings\Administrat
or\Desktop
2) First create a C program, named cyuyan.c, as follows:
C:\Documents and Settings\Administrator\Desktop>copy con cyuyan.c
#include<stdio.c>
void main()
{
printf("Hello World!");
}
^Z
1 file(s) copied.
C:\Documents and Settings\Administrator\Desktop>type cyuyan.c
#include<stdio.c>
void main()
{
printf("Hello World!");
}
Note: ^Z means using the Ctrl+Z shortcut key to terminate the writing of the file.
3) Compile the cyuyan.c file, use the cl cyuyan.c command, as follows:
C:\Documents and Settings\Administrator\Desktop>cl cyuyan.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
cyuyan.c
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:cyuyan.exe
cyuyan.obj
4) Finally, execute the cyuyan.c program, enter cyuyan.exe, as follows:
C:\Documents and Settings\Administrator\Desktop>cyuyan.exe
Hello World!
C:\Documents and Settings\Administrator\Desktop>
------------------------------------------------------------------------------------------
According to the instructions, it seems that it didn't execute successfully. Do you need to install something?
Compiling programs using the CL command in DOS
https://blog.csdn.net/guchaono1/article/details/71438999
_花谢花飞飞_ cl.exe (cl.zip should be 32-bit)
http://vdisk.weibo.com/u/2063062242
Microsoft CL.exe Compiler :Bingsen (The explanation of cl.exe is relatively good)
https://lellansin.wordpress.com/2013/06/11/%E5%BE%AE%E8%BD%AF-cl-exe-%E7%BC%96%E8%AF%91%E5%99%A8/
C Language Compiler CL.exe :veis (cl.7z=64-bit)
https://www.cnblogs.com/veis/p/6940930.html
Last edited by zzz19760225 on 2018-4-9 at 12:06 ]