online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <fstream> #include <string> using namespace std; int main() { char user_input; string str; fstream newfile; //checks if the user wants to enter a string cout<<"Do you want to enter a string?"<<endl; cin>>user_input; //if the user enters n, the program terminates if(user_input == 'n') { cout<<"Your done"<<endl; } //if the user enters y, it asks to enter a string over the alphabet if(user_input == 'y') { cout<<"Please enter a sting over a alphabet:"<<endl; //opens the file to read the string newfile.open("./in.txt", ios::in); //checks whether file is open if (newfile. is_open()) { string str; //reads data from file object and puts it into string while (getline(newfile, str)) { //prints the data of the string cout<< str << "\n"; } //closes the file object newfile.close(); } } return 0; }
wdw dynamic_cast dscs sdc dvc sdv sdv sdv dfv dfvd std::vector<T> ;

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