Two more weeks to go - I hope :-)
I’m still waiting for my Internet connection, which explains the lack of updates lately — sorry about that. The last thing I’ve heard is, that we should go online this or next week — it that holds true it will be great!
It’s been kind of strange to be without an Internet-connection for over a month — I can’t wait to get back online. I have tons of email to read, and lots of webpages to check out. A lot of my new friends use ICQ, so I guess that I’ll also have to give it a try. I’ve always preffered email over those instant-message protocols. Emails are nice because they allow you to read something, think about it for a while, and then answer it a couple of hours later.
I’ve borrowed a really good book about C++ from one of my neighbours. It’s
called Navigating C++ and Object Oriented Design, if I remember
correctly. So far I must say that I’m impressed by C++. The way objects
are handled is sound and straight-forward, it’s surprisingly easy to
overload operators like +
, -
, and so on. It’s also cool to play with
generic containers and template functions. But the best think I’ve learnt
is that you can avoid most of the pointer-madness from C by using
references instead of pointers. Take this procedure as an example:
void triple(int & i) {
i *= 3;
}
int n = 42;
triple(n);
cout << n << endl; // prints 126
It works just like a procedure in Pascal that takes a var
-parameter. In C
you would have to write it as
void triple(int *i) {
*i *= 3;
}
int n = 42;
triple(&n);
printf("%d\n", n);
You have to call the procedure with the address of your integer instead of just passing it as a reference. I guess that I’ll buy the book by Stroustrup, as I’ve heard that it should be the Bible for C++, when I’ve read the other book.
That’s all for now :-)
Leave a comment