1.Write and build your C program which creates a txt file and write into your name and your number 10 times. (You can use FileIO.pdf samples or you can write it on your own ). 2. And use yourprogram.exe file in another process in createProcess method as parameter. Example: bRet=CreateProcess(NULL,"yourprogram.exe",NULL,NULL,FALSE,0,NULL,NULL,&si,&pi); 3. Finally you should submit two C file 1 yourprogram.c (which creates a txt and write into your name and your number 10 times.) 2 mainprogram.c
#include <iostream>
#include <fstream>
using namespace std;
int main() {
fstream file;
file.open("output.txt");
cout << "Enter your username:" << endl;
string username;
cin >> username;
file << "Username: " << username << endl;
file.close();
return 0;
}
Comments
Leave a comment