Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- void save_to_file() {
- FILE* pf;
- if (fopen_s(&pf, "2.txt", "a")) {
- fprintf(pf, "%s", "Hello. This is my file3.");
- fclose(pf);
- delete pf;
- }
- }
- void main() {
- FILE* pf;
- char buff[200];
- fopen_s(&pf, "2.txt", "r");
- while (!feof(pf)) {
- fscanf_s(pf, "%s ", buff, sizeof(buff));
- std::cout << buff; // c++ стиль
- }
- fclose(pf);
- delete pf;
- }
Advertisement
Add Comment
Please, Sign In to add comment