Answers for "c++ include files"

C++
17

c++ files

// basic file operations
#include <iostream>
#include <fstream>
using namespace std;

int main () {
  ofstream myfile;
  myfile.open ("example.txt");
  myfile << "Writing this to a file.\n";
  myfile.close();
  return 0;
}
Posted by: Guest on November-09-2019
0

what is a header in c++

// my_class.h
namespace N
{
    class my_class
    {
    public:
        void do_something();
    };

}
Posted by: Guest on May-17-2020

Browse Popular Code Answers by Language