online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/*************************************************************** * Name: Prof. Rafael Orta * Course: Computer Science & Programming * Class: CS04103 Section: 1 & 2 * Assignment Date: 10/01/20 * File Name: Chapter5.cpp ***************************************************************** * ID: Chapter 5 * Purpose: Demonstrate how to write to and read from a file *****************************************************************/ #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; // Writing to a file ofstream writeFile; writeFile.open ("CSNP.txt"); writeFile << "Writing this to a file.\n"; writeFile << "Writing another line to a file.\n"; writeFile.close(); // Reading from a file ifstream readFile ("CSNP.txt"); if (readFile.is_open()) { while ( getline (readFile,line) ) { cout << line << '\n'; } readFile.close(); } else cout << "Unable to open file"; return 0; }
Writing this to a file. Writing another line to a file.

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue