Bad Morning
October 19, 2005
So far this morning is not going so well. I goto make my first pot of coffee, plug it in and go back to work. When it's done, I goto poor some into my mug and see that it's all water and that I've somehow forgotten to put the coffee grains in. That was slightly irritating, but I let it slide. Well, since this coffee maker is a piece of shit, I had to wait about 15-20 minutes before I could make another pot. All is well until I try helping a friend with a weird problem she was having in C:
dotest(char *foo) { printf("string: %s\n",foo); printf("strtof: %e\n",strtof(foo,NULL)); printf("strtod: %e\n",strtod(foo,NULL)); printf("\n"); }
For some reason, strtof()
(string to float) wasn't working. Notice how the function prototype requires a string. Well, I went ahead and said "durrrrrrr, shouldn't that be an int?" Heh, shortly thereafter I realised that the entire point of the function is to convert a string to float. So yeah, I felt like an idiot.
Then if that's not enough I later spill coffee all over my keyboard. I hope the rest of the day goes a little better for me.