Click here to Skip to main content
14,734,630 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HI i have tried get the information from INI file in borland C++ but im not able get the correct info

config .ini
South =2

What I have tried:

TIniFiloe *str=new TIniFile("config.ini")
int k = str->ReadInteger("SITE","NORTH",0);
here k value im getting alwyas 0 tahts what ever im passing from ReadInteger 3rd argument.
what we have to pass the third argument?

im using Borland compiler
Updated 26-Oct-18 0:54am
KarstenK 26-Oct-18 6:52am
As CPallini hinted in his posting your code used capital letters or ini not. And using the debugger is always a good idea ;-)
Member 13089825 26-Oct-18 6:54am
didnt understand
Richard Deeming 26-Oct-18 8:31am

Is that a typo in your question, or is that actually what you have in your INI file?

1 solution

I would call
Member 13089825 26-Oct-18 5:59am
thanks for your suggestion that was type error
str->ReadInteger("SITE","North",0) i have tried this still not getting expected result
CPallini 26-Oct-18 6:29am
Unfortunately I don't have Borland C++, so I can only suggest you to use the debugger.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900