It’s a Panda’s Life

I believed I had this beautiful set of numbers. Then reality struck and they weren't actually there. On one hand, having fake but nice numbers is bad, on the other hand, those numbers were really pretty. And now I sit around reading and thinking about Haskell and hating on C++. Who would have known that j would differ in

 
  std::vector<int> something[numelts];
  something[7].push_back(2);
  int j = something[7][0];
 

and

 
  std::vector<int> something[numelts];
  something[7].push_back(2);
  int j = (something[7])[0];
 

.
The later is correct, the first is wrong, C++ seems to be treating unparenthisized things as normal array lookups, while the parenthisized thing leads to it using operator[] from vector.

panda

§293 · September 22, 2007 · CS, Hacks · · [Print]

11 Comments to “C++ Hating”

  1. I hate C++ too. It's way easier to work on Visual Studio right now.

  2. I think the rapid development tools have brought software development into another level.

  3. This is the marvelous post that I have come over after huge searches. I am really thankful to you for providing this unique information.

  4. Gunz Hacks says:

    The story notes that the player was stabbed by a 16-year-old. And Artest would have been 12 years old the night he witnessed this.

  5. Djarum Black says:

    On one hand, having fake but nice numbers is bad, on the other hand, those numbers were really pretty. And now I sit around reading and thinking about Haskell and hating on C++. Who would have known that j would differ in

  6. well worth the read. thank you very much for taking the time to share with those who are starting on the subject. Greetings

  7. I hate C++ too. It's way easier to work on Visual Studio right now.

  8. On one hand, having fake but nice numbers is bad, on the other hand, those numbers were really pretty.

  9. I think the rapid development tools have brought software development into another level.

  10. Americans heard a lot about change in the recent election campaign. I say, that whatever they were talking about will not be enough to restructure a world in need of sustainable economies.

  11. Thanks so much for this wonderful website;this is the kind of thing that keeps me on track through out my day. I have been looking around for this site after I heard about them from a colleague and was pleased when I was able to find it after searching for awhile. Being a avid blogger, I’m happy to see others taking initivative and contributing to the community. I just wanted to comment to show my support for your work as it’s very interesting, and many writers do not get admiration they deserve. I am sure I’ll visit again and will recommend to my friends.

Leave a Reply