Sunday, July 16, 2017

Deletion and Updates

It has been quiet around here for almost 2 weeks, hasn't it? Then all of a sudden a new blog post is being uploaded and another deleted? What is going on? For one thing I didn't change any of my policies, for instance never change code once it has been submitted. Only in the case where there are bugs, or the code is in other ways being found to be faulty. So far it wasn't necessary to remove any code, and there is always a first, and this is the first case this has happened. 

The previous code for Programming Challenge 12.11 contained an error of sorts, or design-flaw rather. I sought help in a Coding community and received plenty of it. I got more help than I could ever have hoped for actually. In the beginning there was I and there was my code, I posted some snippets, of which I thought worked very well. In the following discussion I learned that I should not use a char array for division names but instead string class objects. This then led to lots of headaches on my part as I tried figuring out how to get a string in a struct into a binary file. 

I tried hard, asked many questions, and eventually managed to make things work. But instead of the fruits of all my labor in the past couple of days all you are getting to see is what seems like code containing minor changes? No fair! Of course it wouldn't be fair if I wouldn't share it with you. Here it is then, free for you to download and enjoy in all its sad glory. 

Example Files: CppSData.cpp
                         Xtra.dat

Of course you might think, why has this person not uploaded this code, and instead decided to upload another code as the solution to the Programming Challenge? To be honest with you? Doubts. While indeed the above code works, and I tested it numerous times, I still doubt that I should go with it until I learn way more about things. Until then I stick with what I know and can predict, which is reflected in the code I uploaded as solution. This will stay online as long as this blog will be live. (So, hopefully for eternity and a day ;-))

With this, I think, I will call it a day, and work hard to (finally) solve the next Programming Challenge. As always I would like to thank my visitors old and new, from all over the world, thank you for dropping by! I hope you found what you came looking for. Also many thanks for all the +s! My fellow learners I wish that you have a pleasant summer, and temperatures in a range allowing you to solve your own programming challenges without your brain melting. I hate the thought that I be learning alongside one of these:

Picture Copyright: PopCap Games


No comments:

Post a Comment