.ini files are files used by programs to store preferences and other data. .ini stands for initialization. These files are often used to store information on User Preferences. These files are more effecive then storing data in text files because .ini files allow data to be stored with a key and in sections. A typical .ini file would look like the following:
[ Section Name ]
Key=Data

An example of this might look like the following:
[ Player Data ]
Name=Kevomaco2
Strength=100
Wisdom=100

[ Location Data ]
Left=100
Right=100

etc.
As you can see, .ini files can store data more effectivly then simple text files. However, in Visual Basic, at least, all data coming from an .ini file must have the length defined . This makes for difficult situations, especially in the case of passwords.
Ex. This is psuedo-code, there are inbetween steps not mentioned here. Let's say you want to store a person's password. You would create this .ini file.
[ Login Data ]
Name=Kevomaco2
password=test

Then you would check the password against the password entered.
If txtLogIn.text=DataRetrieved Then
Enter site
End If

But, even if txtLogIn.text=DataRetrieved, that statement would never run. Because, DataRetrieved looks something like this:
"test__________", where _=space
This can cause problems with .ini files. I do not know if the same problem applies to C++. But, besides this, .ini files are an excelent way to store data, allowing for organization not seen in text files.

Log in or register to write something here or to contact authors.