Y
Y
ygg_712022-02-08 12:24:43
C++ / C#
ygg_71, 2022-02-08 12:24:43

How to write code in c++ that will write messages to a document?

Hello, I'm new to ++, I'm currently learning from shieldt's guide. I'm wondering what tools or libraries you need to have to do this? Please, help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KryOne, 2022-02-08
@KryOne

#include <fstream>

int main()
{
  std::ofstream out("test.txt");
  if (out.is_open())
  {
    out << "Hello, World!";
  }
  
  out.close();

  return 0;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question