read and write .ini

i am using dev blood shed c++ with windows vista 32
as for my problem how do you read from a .ini file and set it as a variable
and also write to a variable to a .ini file
p.s can you write and read from ftp
1: I recommend switching from Dev-C++. That thing is ancient...

2: http://cplusplus.com/doc/tutorial/files/

3: As for using FTP, you can, but that's probably going to be a bit above your level for now. When you feel you're ready to tackle it, then I recommend looking... oh, say... http://curl.haxx.se/libcurl/

-Albatross
Last edited on
Use clode::blocks
codeblocks.org
or Visual C++ express (both free).

Noone uses blood shed :P
@Albatross : hai, i'm still newbie here, can u tell me the reasons why Dev C++ is ancient ?? thanks .
The reason why Dev C++ is ancient is because the last update to both the source and binaries folder was in 2005 (said Sourceforge):
http://sourceforge.net/projects/dev-cpp/files/

There was an update in 2008, but... er... two years is still a long time.

-Albatross
i also have visual c++ microsoft pro trial
also how is writing to a ftp not the same as writing to a desk top file
dont you just use the directory?
@Albatros : thanks for your information .. what is the best now ?
There are a number of solutions you can google for "c++ ini".
This one looks nice: http://code.jellycan.com/simpleini/
FTP is short for File Transfer Protocol, and AFAIK the standard library doesn't include any classes for dealing with that. This is where I found out about libCurl from:
http://stackoverflow.com/questions/1244095/c-ftp-library

As for what's the best Compiler/IDE combo... ah, hehehe. That's totally a matter of personal preference. I use Clang/Eclipse, but others may want to use Visual C++ Express, or g++/Code::Blocks... there's an article here that lists a few.

http://cplusplus.com/articles/chrisname1/

-Albatross
Last edited on
Thank you very much for the information @Duoas, and @Albatross ...
I am trying to use Ubuntu now, My windows just for my works only . . .
If like this programming code, i like to play around in Ubuntu.
I'm using IDE Geany, how do you think about it ?? is it nice or any better than geany maybe ??
:D

@Duoas, btw Simpleini is IDE or Compiler for C++ ?
Simpleini was in response to the OP's question #1. :)

As for Geany... I've heard of it. I also used it a long time ago... but I recall also switching to Code::Blocks a little bit later. :P

-Albatross
Last edited on
@Albatros : is Code::Blocks better than Geany (maybe your reason why switch)?? =))
so albatross to write to a ini in the ftp do i need that lib?
@lucifier: I don't remember Geany too well. What I do remember is that I thought it was both too lightweight for me to consider it a full IDE, and too heavy for a lightweight IDE. :/ I'd suggest you try both and decide for yourself. :)

@harpo: Again, as far as I know, if you're going to use FTP, you're going to need a library that can deal with that protocol, and I seriously don't think the IOstream library includes pre-defined objects that can perform those communications. libcURL, however, AFAIK, supports FTP... and cURL is
a library for transferring data using various protocols.
^Wikipedia.

-Albatross
Last edited on
@Albatross : Ok, thanks
ok so i read the input/output files thing and tested it and i now understand if and why i need a lib
my next question is part of my first after reading from a text document
how do i set a line not the whole document as a variable and displaying the value of the variable
aka the text file line
p.s thanks for the help so far
Topic archived. No new replies allowed.