Thread: ini files

  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    24

    ini files

    Hello,

    How do I use ini files to read constants into my program? The ini file is written as follows:

    Code:
    [CONSTANTS]
    Number_of_Integers = 4
    FileName = OpenFile.txt
    Currently, these constants are defined in my code, but they are defined in the traditional way...(example #define FileName = OpenFile.txt). I would like to use ini files to help simplify my code and make things a little easier to update.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    If you are using windows, then you can use the functions:
    GetProfileInt()
    GetProfileString()

    Using .ini files is pretty outdated these days though. Why not use the registry instead? After all, that's what its there for.l

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Working with muliple source files
    By Swarvy in forum C++ Programming
    Replies: 1
    Last Post: 10-02-2008, 08:36 AM
  2. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 02:41 PM
  3. Folding@Home Cboard team?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 398
    Last Post: 10-11-2005, 08:44 AM
  4. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM
  5. ini files
    By bigSteve in forum C Programming
    Replies: 1
    Last Post: 03-05-2002, 12:39 PM