system()函数的用法 [英] usage of system() function

查看:68
本文介绍了system()函数的用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是否可以使用此代码打开Internet Explorer,如果我编译程序文件并使用该程序的.exe文件,如果是,那么请告诉我头文件..

Can I use this code to open Internet explorer if i compile the program file and use the .exe file of the program if yes then pls also tell me the header file..

展开 < span class =codeDivider> | 选择 | Wrap | Line数字

推荐答案

查看 system 的文档。 (这些是一般代码卫生建议;它们可能无法解决您的问题。)
  • 它有一个您应该检查的返回值。
  • 考虑是否传递 NULL 时的行为会对您有所帮助。
Review the documentation for system. (These are general code hygiene suggestions; they probably won''t lead to a solution to your problem.)
  • It has a return value that you should be checking.
  • Consider whether its behavior when passed NULL would be helpful to you.
展开 | 选择 | Wrap | 行号


你也可以逃脱你的命令中的反斜杠(你必须在其他语言中执行此操作我知道)。


马克。
It''s also possible you''ll have to escape your backslashes in the command (you have to do this in other languages I know).

Mark.


这是可能的,这是必要的。与C中的许多其他类C语言一样,字符''\''在字符串中具有特殊含义,它是转义序列。根据它所做的,它有一个特殊的meanins,即''\ n''是换行符,''\'''是零字符(终结符)。如果它没有特殊意义则忽略''\ q''是字符''q''。


如果你想要一个\字符那么你需要序列''\\''。
It is more than possible, it is necessary. As with many other C like languages in C the character ''\'' has a special meaning inside a string, it is the escape sequence. Depending on what follows it made have a special meanins, i.e. ''\n'' is the newline character, ''\0'' is the zero character (the terminator). If it has no special meaning then it take is ignored ''\q'' is the character ''q''.

If you want a \ character then you need the sequence ''\\''.


这篇关于system()函数的用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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