C++ Instructors

Pages: 123... 6
Who certifies these goons? And what are they putting into these poor students heads? malloc() to allocate memory for a subclass instead of new?

I've seen such horrors on this site that it is amazing these students aren't crippled for life!
Those who can, do. Those who can't, teach.
closed account (z05DSL3A)
...and those that can't teach administrate.
Good students will quickly recognize the bad teachers and the good teachers. Crappy students... Well, they just don't really care one way or another.

I remember part of the registration ritual through college was to find out who the crappy teachers were (ever single Frat and Sorority had a list of them, and that list was available to any student whatsoever), and avoid their classes at all costs. That wasn't always possible though. For example, The organics of Chem class with the good teacher overlapped the Mechanics of Solids class with the good teacher my Sophomore year. I wound up taking Solids with a really crappy Eastern European prof (no dig towards Europe intended there).

The next semester I got stuck with the crappy Differential Equations prof.

In both cases, in fact in all cases, the students themselves had organized study sessions with students from the other classes. On the flip side of things, I've seen plenty of posts here from people who are obviously only making a last ditch effort to get an assignment done, and clearly don't really care about actually learning the material.

Besides, it's healthy experience for when they finally jump into the working pool if they ever end up with a goon for a boss. And that's always a very real possibility no matter what field you're in.
Last edited on
It's probably because languages update so frequently, so when you switch between it's a hassle to rediscover the new conventions. Especially when you're being paid to teach the old ones.
What's wrong with malloc()? :(
I use it all the time, although in C++ I use new.
What's wrong with malloc()? :(
I use it all the time, although in C++ I use new.
Hurr durr. It's not like you have much of a choice in C.
malloc() doesn't call constructors.
helios wrote:
It's not like you have much of a choice in C.

What? There's malloc, realloc, uhhhh... there's like an "alloc" for every single consonant in the alphabet...

malloc() doesn't call constructors.

Which makes it worse?

Hurr durr

Which reminds me; in a German exam yesterday one of the people in the exam was called "Herr Durr" (Herr is pronounced similar to "hair" in English; it means Mr.)
I'm getting kind of suspicious of the company that makes those exams. Another one featured someone called Wynn (pronounced like win) and the first sentence contained the string "lost the game."
Last edited on
there's like an "alloc" for every single consonant in the alphabet


I only know of the 3:

malloc (allocates memory)
realloc (reallocates memory)
calloc (allocates memory then zeros it)
http://en.wikipedia.org/wiki/Exaggeration

There's also "talloc" if you've read K&R. Then again, that was specific to the book.

But never mind.

Why would you use realloc? What benefits would there be? Is it faster to reallocate memory than to allocate it?
Is it faster to reallocate memory than to allocate it?
It may be. Allocators rarely get exactly as much memory as you ask for, so sometimes it's possible to "resize" the allocated block by tinkering with its state, usually held a couple bytes before its start.
So this is the stuff that doesn't get taught. But doesn't new get rid of these issues? Like allocating the correct memory block etc.
Well technically I'm "taught" by a conglomerate of people on the internet and books. So obviously I'm going to miss things :)
But doesn't new get rid of these issues? Like allocating the correct memory block etc.
Uh... What?
IIRC, all new does different is call constructors. Maybe I don't know what I'm talking about...?
Well technically I'm "taught" by a conglomerate of people on the internet and books.


T.T I want books
Buy one then. K&R is good.
I can't afford one T.T
Google "Title_Of_The_Book_You_Cant_Afford pdf"
Really? What about viruses or other malware generally associated with anything free on the internet that is not open source?
Pages: 123... 6