All pastes #757553 Raw Edit

good ver :P

public cpp v1 · immutable
·published 2007-11-01 13:04 UTC
rendered paste body
#include "stdafx.h"#include <stdlib.h>#include <iostream>#include <string>#include <fstream>#include <vector>using namespace System;using namespace std;void loadConfiguration(string fileName, vector<string> &content_indices, vector<string> &content_values) {	// Read configurations.	ifstream file(fileName.c_str());	string line;	string name="cyc";	string value;	string inSection = "dupa";//std::string content_indices[255];//std::string content_values[255];	int posEqual;	int i;	while (getline(file, line)) 	{        if ( !line.length() ) continue;        if ( line[0] == '#' ) continue;        if ( line[0] == ';' ) continue;        if ( line[0] == '[' )		{			inSection = trim(line.substr(1, line.find(']')-1));            continue;			posEqual = line.find('=');			name = trim(line.substr(0, posEqual));			value = trim(line.substr(posEqual+1));			content_indices.push_back(inSection+"/"+name);			content_values.push_back(value);		}	}}int main(array<System::String ^> ^args) {	vector<string> indices;	vector<string> values;	loadConfiguration("config.ini", indices, values);	std::cout << indices[0];	return 0;}