#include
int main()
{
system("echo "以下是..,你懂得... ">a.txt");
system("ls / >>a.txt");
}
错误提示:
l.c: In function ‘main’:
l.c:4:2: error: stray ‘\344’ in program
l.c:4:2: error: stray ‘\273’ in program
l.c:4:2: error: stray ‘\245’ in program
l.c:4:2: error: stray ‘\344’ in program
l.c:4:2: error: stray ‘\270’ in program
l.c:4:2: error: stray ‘\213’ in program
l.c:4:2: error: stray ‘\346’ in program
l.c:4:2: error: stray ‘\230’ in program
l.c:4:2: error: stray ‘\257’ in program
l.c:4:26: error: expected identifier before ‘.’ token
l.c:4:26: error: stray ‘\344’ in program
l.c:4:26: error: stray ‘\275’ in program
l.c:4:26: error: stray ‘\240’ in program
l.c:4:26: error: stray ‘\346’ in program
l.c:4:26: error: stray ‘\207’ in program
l.c:4:26: error: stray ‘\202’ in program
l.c:4:26: error: stray ‘\345’ in program
l.c:4:26: error: stray ‘\276’ in program
l.c:4:26: error: stray ‘\227’ in program
D调漫步 于 2011-08-15 13:56:09发表:
路过
_forever_ 于 2011-08-15 12:12:29发表:
似乎
echo as
echo “as”
执行效果没什么区别
echo /“as/” 才输出“”
#include
int main()
{
system("echo \\\"以下是..,你懂得...\\\">a.txt");
system("ls / >>a.txt");
}
_forever_ 于 2011-08-15 11:55:34发表:
"
似乎要用转义符(\)的吧
peipei20140 于 2011-08-14 16:15:31发表:
这种问题真不知道该怎么回答,就不能把问题描述清楚吗?
yiku123 于 2011-08-13 16:26:32发表:
楼主要套件那句话很个性
年年年 于 2011-08-13 15:31:25发表:
#include
int main()
{
system("echo \"以下是..,你懂得... \">a\.txt");
system("ls / >>a\.txt");
}
linux C我不大懂。。但是perl里面也有system。双引号里面的一些符号需要转义。不知是否正确,你试试看吧
jinger7281 于 2011-08-12 23:50:50发表:
#include
int main()
{
system("echo "以下是..,你懂得... ">a.txt");
system("ls / >>a.txt");
}
你C没学好啊,再说system调用你也没明白什么用法,有点急功近利了
#include
#include
int main(){
system("echo 以下是...,你懂得 1>a.txt");
system("ls / 1>a.txt");
return 0;
}
记住函数前边如果声明了返回类型的时候一定要return一下!
yanyongkg 于 2011-08-12 18:29:34发表:
看到这种不清不白的提问,很是无语。。。