[ create a new paste ] login | about

Link: http://codepad.org/eyxunHot    [ raw code | fork ]

scwizard - C++, pasted on Feb 14:
#include "stdafx.h"

using std::wcout;
using std::endl;
using std::wstring;

namespace fs = boost::filesystem;

int wmain(int argc, wchar_t* argv[]) {
	wstring eight_ball(L"➑ball");
	wstring file_data;

	// Use boost to get the config file path.
	fs::wpath config_path = fs::current_path<fs::wpath>();
	config_path /= fs::wpath(L"config.ini");

	// Open the config file and extract the word from it.
	fs::wifstream config_file(config_path, fs::wifstream::in);
	config_file >> file_data;
	config_file.close();

	if(file_data == eight_ball) {
		wcout << L"Program is correct" << endl;
	}
	else {
		wcout << L"Program is incorrect" << endl;
	}	
}


Create a new paste based on this one


Comments: