| kadaj (6) | |
|
hi. As I know to make a file we should write like this: FILE *fp=fopen("temp.txt", "w+"); but I want to for n students, get the name of the students from the user & for each student make a file with his/her name how can i do this?! Is there another way to make files?! | |
|
|
|
| doug4 (233) | |
|
fopen is very "C". You should look into the C++ ofstream class. http://cplusplus.com/reference/fstream/ofstream/ Notice the constructor that takes a file name string. | |
|
|
|
| usandfriends (186) | |||
***Please use this code only as an EXAMPLE.*** | |||
|
Last edited on
|
|||
| kadaj (6) | |
| thx! :) | |
|
|
|