Wednesday, June 08, 2005

Back to C++ basics...

C++, as far as my classical-C-oriented-self is concerned, is always full of surprises. I was working on this touch utility, one of my weekend pet projects, when I ran into some "unexpected" results. I had a self-referencing operator (although valid as far as C++ is concerned) which causes my app to give rather off the mark outputs.

This is a valid code:

i = i;

but one has to carefully check this before the operator is ran. For instance, the operator may free up the memory of the left operand and copy over the memory from the right operand. This would result in freeing the memory before it is even copied.

Once the project is up-and-about (and free of bugs, i hope), I will be posting the code here for all to test and play around with. I plan to use this as a component of a push-updates script (for a few files actually) to about 20 servers distributed all throught our Asia-Pac sites. Update arrives --> script runs --> copies the updates --> touches the updated files (and does *other* stuff) --> logs the operation. That's KISS for you. Keep it simple, (_and_) stupid.


Anonymous Anonymous said...

Good blog. Keep up the good work! I have been looking for information about winxp disk cleanup for my site winxp disk cleanup

7:14 AM  

Post a Comment

<< Home