系统调用和命令
如何在 Windows 的 C++ 程序中进行系统调用,因为 system() 方法允许系统命令,两者之间有什么区别?
编辑:我的意思是系统调用和系统命令之间的区别
编辑:我发现系统命令是可以在cmd中运行的命令,您也可以通过system()方法调用它们,但我仍然不知道如何制作系统调用
How would you make system calls in a c++ program for windows, as the system() method allows for system commands, also what's the difference between the two?
EDIT: I mean difference between system calls and system commands
EDIT: I have found that system commands are commands that you can run in cmd, you can also call these through the system() method, but I still don't know how to make system calls
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个基本问题。在线查找教程或书籍。此外,MSDN 还提供了大多数 Win32 函数的文档。
This is a basic question. Find a tutorial online or a book. Also, MSDN has documentation on most of the Win32 functions.
如果您指的是通过 Win API 调用 CopyFile 等系统函数与通过 system() 调用 copy 之间的区别,那么通过使用系统函数,您可以静态或动态调用复制文件的代码。通过调用 system(),它会生成一个单独的进程,该进程调用名为 copy 的可执行文件并向其传递参数以复制文件。
If you mean the difference between calling a system function such as CopyFile through the Win API vs calling copy through system(), then by using the system function you can either statically or dynamically call the code that copies the file. By calling system() it spawns a separate process which calls the executable called copy and passes it parameters to copy the file.