![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-14 23:47 |
47,812 topics / 349,917 posts / today 0 new / 48,268 members |
| DOS开发编程 & 发展交流 (开发室) » 请问在DOS或CMD命令行中如何实现C语言编辑的? Translated as: How to implement C language editing in DOS or CMD command line? |
| Printable Version 3,612 / 2 |
| Floor1 zzz19760225 | Posted 2018-04-06 03:47 |
| 超级版主 Posts 2,020 Credits 3,673 | |
|
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 ] Attachments dm111.png (59.32 KiB) dm222.png (9.55 KiB) CL.zip (160.27 KiB) dm333.png (4.59 KiB) CL.7z (3.8 MiB) mlhc.png (66.77 KiB) |
|
| Floor2 LoggerVick | Posted 2018-04-06 17:34 |
| 中级用户 Posts 212 Credits 365 | |
|
Because the CL.EXE linker is not placed in the C:\ location under your WINDOWS. The CL.EXE linker is not placed in the A:\ location of DOS.
|
|
| Floor3 zzz19760225 | Posted 2018-04-09 12:00 |
| 超级版主 Posts 2,020 Credits 3,673 | |
Originally posted by LoggerVick at 2018-4-6 17:34: ---------------------------------------------------------------- The cl.7z one worked, although pressing Enter automatically adds an extra line, but it can run. Just modify the file content manually! :( Why did it work the first time and then all errors later? Mistake in entering i and l. (But the two in the first picture are l instead of i!? It's a text display issue, actually it's i.) [ Last edited by zzz19760225 on 2018-4-9 at 14:14 ] Attachments mlhc1.png (20.03 KiB) mlhc2.png (23.12 KiB) mlhc3.png (30.57 KiB) mlhc4.png (16.41 KiB) |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |