File reading.ini

Asked

Viewed 451 times

1

It is possible to read variables in arquivos.ini with C++?

Ex:

host = "localhost"
name = "username"
pass = "password"
port = 1010

When reading from this file I set through the ifstream.

ifstream dados;
dados.open("arquivo.ini); 
while(getline(dados, linha)){
void sethost(linha){
this->host = linha;
}
}

Since I only want the value of each variable ex: host I want localhost.

1 answer

2


Browser other questions tagged

You are not signed in. Login or sign up in order to post.