E
enki
I am trying to figure out basic reading and writing of files, I realy
havn't seen good examples. I wrote a simple program to write a file.
I would like to know where to get a good lesson on using files.
#include <cstdlib>
#include <iostream>
#include <stdio.h>
using namespace std;
int main(int argc, char *argv[], char *temp[])
{
int lp = 0 ;
for(lp = 0 ; lp != argc; lp ++){
cout<<argv[lp]<<"\n";
}
FILE *ptr = fopen("data.txt", "w");
for(lp = 0 ; lp != argc; lp ++){
//what goes here to write to <<argv[lp]<<"\n";
}
fclose(ptr);
system("PAUSE");
return EXIT_SUCCESS;
}
havn't seen good examples. I wrote a simple program to write a file.
I would like to know where to get a good lesson on using files.
#include <cstdlib>
#include <iostream>
#include <stdio.h>
using namespace std;
int main(int argc, char *argv[], char *temp[])
{
int lp = 0 ;
for(lp = 0 ; lp != argc; lp ++){
cout<<argv[lp]<<"\n";
}
FILE *ptr = fopen("data.txt", "w");
for(lp = 0 ; lp != argc; lp ++){
//what goes here to write to <<argv[lp]<<"\n";
}
fclose(ptr);
system("PAUSE");
return EXIT_SUCCESS;
}