Click here to Skip to main content
15,895,084 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
[SITE}
North=1
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
Posted
Updated 25-Oct-18 23:54pm
Comments
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    
[SITE}

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

1 solution

I would call
C++
str->ReadInteger("SITE","North",0)
 
Share this answer
 
Comments
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