All pastes #100972 Raw Edit

Untitled

public cpp v1 · immutable
#100972 ·published 2006-07-26 16:22 UTC
rendered paste body
#include <iostream>#include <string>#include <fstream>using namespace std;int main(int argc, char *argv[]){	ifstream fin;	string name = "";	fin.open ("helloworld.txt");	if (fin.fail())	{		cout<<"Error could not open file!" <<endl;	}	getline(fin, name);	if (name == "")	{		cout<< "Hello World!"<<endl;	}	else 	{		cout<< name << "!" << endl;	}	fin.close();}