Thread: Problem with vector iterator

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Programming Ninja In-T...
    Join Date
    May 2009
    Posts
    827
    Quote Originally Posted by Elysia View Post
    I didn't post anything because the code and the first post was too intimidating.
    Clearly, it showed that there was a lot that could have been simplified, such as removing operators, and stuff. Instead of having a big complicated hierarchy, a simple one that demonstrated the problem could be used.
    Umm...158 lines is big? I am glad then that I did not show the real code of the project in which the problem first originated...I imagine that would have, like, caused you to have a heart attack, or something.

    To be fair, I didn't read the code. I didn't do it because it was too intimidating. Especially the whole first post. But I know from previous replies that Programmer_P tends to write extremely complicated code than ask for help in fixing it instead of simplifying it.
    I gave up reading the first post TBH. I made it about half-way, which is pretty generous for me. So yes, while commenting on some code is nice, explaining code with words like Programmer_P did in the first post just usually leads to a dead end. A snippet of code would have explained more than a thousand words.
    And because of those "earlier posts" you referred to, to which you basically said the same thing, to simplify the code, I did just that, and STILL you complain??
    I'm an alien from another world. Planet Earth is only my vacation home, and I'm not liking it.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Programmer_P View Post
    Umm...158 lines is big? I am glad then that I did not show the real code of the project in which the problem first originated...I imagine that would have, like, caused you to have a heart attack, or something.

    And because of those "earlier posts" you referred to, to which you basically said the same thing, to simplify the code, I did just that, and STILL you complain??
    158 lines is rather big for asking help, especially when it's not all whitespace.
    Just look at the original code: tons of unnecessary properties and declarations. You could have removed them and simplified the code. Don't tell me that it's as simple as it can get.
    Now, as for the explaining of the code, perhaps these advices may help you reduce the complexity of your posts in the future.

    First, avoid writing a wall of text. It discourages people. Try to write as little as possible, if possible.
    Separate your text into paragraphs. It might even be good to use a blank line between paragraphs to increase readability. Believe me, it helps a ton. Find places to split your text into paragraphs! Force it, if necessary.
    And lastly, try to show what you mean with code and simplify your explanation. Don't write "first I did X, then Y, then Z, and that caused A, and then B, and finally C. Then I tried D because I was bored but realized that E was better because of F...". Show your approach with code instead. Easier to read. Really. Chaining lots of things like that makes it hard to read. Split it. Write code, explain why you did it and what happened. Then do the next, and so on. It may be a little longer but it's easier to read.

    I know, writing on message boards and asking for help is a science in itself, but it never hurts to try these things, even if it might be difficult to understand what exactly they mean.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem using a vector iterator in a loop.
    By M.Richard Tober in forum C++ Programming
    Replies: 6
    Last Post: 10-29-2011, 01:53 PM
  2. vector and iterator problem
    By BeBu in forum C++ Programming
    Replies: 10
    Last Post: 03-11-2009, 07:38 AM
  3. Vector Iterator Help
    By (TNT) in forum C++ Programming
    Replies: 5
    Last Post: 11-04-2007, 02:53 PM
  4. vector<object>::iterator Help
    By The Brain in forum C++ Programming
    Replies: 16
    Last Post: 03-26-2006, 07:22 PM
  5. Iterator _ erasing from a vector help
    By Hexxx in forum C++ Programming
    Replies: 1
    Last Post: 03-22-2006, 07:43 PM