Title: [Completed Transaction]Newbie C++ help [2BTC] Bounty Post by: CatsLikeToStretch on April 01, 2012, 03:20:10 PM I am trying to teach myself C++ and I am stuck on something. I am trying to write a program that writes a series of image files (in .pbm format). I want the files to be named based on the value of an integer variable. For example, if the variable contains the value 1045 then I want to output data to a file called 1045.pbm. I will pay you 1/2 of the bounty if you supply code that works and I'll pay the other half for explaining to me, in terms that a complete beginner like myself, what the purpose of the various bits are code are. Thanks in advance.
If you don't believe I will actually pay - you can check https://bitcointalk.org/index.php?topic=73989.0 on the beginner board where I have already paid out for help. Thanks in advance. Title: Re: Newbie C++ help [2BTC] Bounty Post by: Matoking on April 01, 2012, 04:16:35 PM What IDE are you using at the moment? (I use Qt Creator, for an example, some others I can recall from the top of my head are Microsoft Visual Studio and Code::Blocks)
The content of the .pbm files don't have to be anything specific, if I'm correct? Title: Re: Newbie C++ help [2BTC] Bounty Post by: CatsLikeToStretch on April 01, 2012, 04:20:53 PM I am using geany. I am running ubuntu 10.04.
Quote The content of the .pbm files don't have to be anything specific, if I'm correct? I am writing data to each of the files. I am trying to generate a series of images, and the name of the image files should be based on the value of an integer variable in the code. Title: Re: Newbie C++ help [2BTC] Bounty Post by: yogi on April 01, 2012, 04:30:33 PM #include <sstream>
std::string GenFileName(int i) { std::stringstream out; out << i << ".pbm"; return out.str(); } Title: Re: Newbie C++ help [2BTC] Bounty Post by: Matoking on April 01, 2012, 05:02:46 PM Code: #include <iostream> This program should create ten .pbm files. I'll have to admit I'm not very familiar with std, so the file.open(stream.str().data()) portion could be probably done in a better way. Title: Re: Newbie C++ help [2BTC] Bounty Post by: CatsLikeToStretch on April 01, 2012, 06:48:36 PM Quote file.open(stream.str().data()); Thats the bit I couldn't get right before. Thanks for your help and explanation. 2.0001 BTC were just sent to 1M8Xa6crWwrymzUayCML1MJGqjF4JdGHHx They should show up in the next bock. Thanks for your help. Title: Re: Newbie C++ help [2BTC] Bounty Post by: Matoking on April 01, 2012, 06:52:31 PM Thanks very much. :)
|