初学C++ 求见教
初学C++ 求指教有两个问题 一个是调用其他程序 #includecstdlibusing namespace stdint main(){system(
初学C++ 求指教
有两个问题 一个是调用其他程序
#include<cstdlib>
using namespace std
int main()
{
system("Hello");
}
就是问一下 system后面的格式 是文件名 还是什么 有格式要求吗 .cpp 还是别的什么 求具体代码 事例 谢谢
第二个问题 文件的读写
#include<string>
#include<fstream>
using namespace std;
int main()
{
ifstream in("Scopy.cpp");
ofstream out("Scopy.cpp");
string s;
while(getline(in,s))
out<<s<<"\n";
}
不应该是我输入字符 然后写入文件吗 怎么不对 ???? 求指教
[解决办法]http://wx782870649.blog.163.com/blog/static/1298916412012310301863/
[解决办法]system是系统调用
内核中执行的