27

Вопрос по c++, file – Добавление новой строки в файл (файл журнала) в C ++

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Apr 09, 2012, 9:12 AMот

Error: User Rate Limit Exceeded<code>append mode</code>

Apr 09, 2012, 9:44 AMот

3ответа

1

Error: User Rate Limit Exceeded

FILE * pFile;
pFile = fopen ("myfile.txt","a");

Error: User Rate Limit Exceeded

fstream filestr;
filestr.open ("test.txt", fstream::app)
50

Error: User Rate Limit Exceededios_base::appError: User Rate Limit Exceeded

std::ofstream log("logfile.txt", std::ios_base::app | std::ios_base::out);

Error: User Rate Limit Exceeded

#include <ios>
#include <fstream>

int main(){
    std::ofstream log("logfile.txt", std::ios_base::app | std::ios_base::out);

    log << "line\n";
    return 0;
}

Error: User Rate Limit Exceeded

line

Error: User Rate Limit Exceeded

line
line

Error: User Rate Limit Exceeded

3

Error: User Rate Limit Exceeded

#include <fstream>
#include <iostream>
using namespace std;
int main() {
  ofstream out("try.txt", ios::app);
  out << "Hello, world!\n";
  return 0;
}

Error: User Rate Limit Exceeded

RelatedQuestions