Archive for February 14th, 2008

Tweets for 2008-02-14

  • I made it home in the morning without incident, but then I got stuck in an inch of slush when I tried to park. #
  • It took about an hour to dig enough of the slush out to get my car out of the middle of the street. #
  • And now… my arms, shoulders, back, behind, and legs are all tired and sore and really don’t want to be at work. #
  • Night Mur. #
  • Paper curl causing stacking issues. I hate the randomness of paper curl. #
  • I ate my pizza and now am ready for my nap. Too bad I still have a few hours of work left. #
  • Hey! No shoveling today! Yeah! I need more !!! #

Bubble Sort [C++]

Last time, I said ::

int sort[] = { [10, 2, 8, 4, 6, 0] };  // elegiac pointed out that arrays need curly braces, I like square.  So I combined them.

And I was wrong.  I got a compile error that disappeared as soon as I removed my beloved square braces.

int sort[] = {10, 2, 8, 4, 6, 0};

works out just fine.

My main loop that moves things around seems to be working fine, I’m just only getting that single pass.  I’m trying to work out how to get a while to work for me, but for now… I’m happy with my single pass.

One thing elegiac had asked me was about the std::endl; that I had tacked into the program at the very end.  Testing it out showed me that it didn’t seem to make any difference at all whether I left it in or took it out.

At this point I am wondering if it makes more sense to keep thrashing at this or to look at my code samples and see how others have done this.  I’m certainly gaining a better understanding of how C++ feels doing it this way, but I think that the templating nonsense is still so far out of reach that I am not going to be able to thrash myself to an understanding of it.  I am going to need help.

I hate asking for help.