All pastes #77072 Raw Edit

Untitled

public cpp v1 · immutable
·published 2006-07-02 15:44 UTC
rendered paste body
#include <iostream>#include <fstream>using namespace std;int main(){    ifstream file("input.txt", ios::in);    string line;    while(!file.eof())    {        getline(file, line);        if(line.size()) // ignore empty lines        {            string variable = line.substr(0, line.find_first_of(":"));            if(variable == "release") // Only checking release            {                cout << "Variable: " << variable << endl;                float value = atof(line.substr(line.find_first_of(":")+1, line.size() - line.find_first_of(":")-1).c_str());                cout << "Value: " << value << endl;            }        }    }    file.close();};