Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

How to Read a config.ini

hey guys, i want my program to read a config file. i have gotten it to make a config.ini and put code inside of it
Code:
Code
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
    int Delay = 0;
    int Overshoot = 0;
    int Cooldown = 0;
   ofstream file_;
    file_.open("Config.ini");
    if(file_.is_open()){
    file_ << "Delay = \n";
    file_ << "Overshoot = \n";
    file_ << "Cooldown = \n";
     }
    file_.close();
So in the config to ini you type
Delay = 22
How do i make that change int Delay to 22?
Thanks for your time :)
(Sep 14, 2015 03:54 AM)Yani Wrote:  Here's a little class you can use:
http://www.codeproject.com/Articles/8342...form-INI-f

Thanks man! I'm new to coding just learned the basics . Sorry if it was a dumb questions
(Sep 14, 2015 03:54 AM)Yani Wrote:  Here's a little class you can use:
http://www.codeproject.com/Articles/8342...form-INI-f

Thanks man! I'm new to coding just learned the basics . Sorry if it was a dumb questions
(Sep 14, 2015 03:54 AM)Yani Wrote:  Here's a little class you can use:
http://www.codeproject.com/Articles/8342...form-INI-f

Thankyou. I'm new to coding just learnt the basics. Sorry if it's a dumb question.
The triple post though..
I suggest you try to write your own simple parser if you are new though.
(Sep 14, 2015 04:48 AM)morph Wrote:  The triple post though..
I suggest you try to write your own simple parser if you are new though.

Yeah didn't mean to triple post, got bad internet aye. Aight I will try man.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by TheArchitectDec 31, 2022 02:38 AM 12 301 Dec 31, 2022 02:38 AM
Last Post: TheArchitect
[C#] by SIM-4785719Jul 27, 2020 06:40 PM 6 210 Jul 27, 2020 06:40 PM
Last Post: gigajew
[.NET] by Visual FreedomApr 17, 2017 09:13 AM 12 532 Apr 17, 2017 09:13 AM
Last Post: gigajew