Wednesday, October 05, 2005

The wonders of C or in other words...lesson learned....

a) Define the size of your bloody arrays, and initialize them. This will rid you of many a Segmentation Fault.

b) Habit earned from functional programing (and elsewhere) - Send in strings as arguments. Call by value rather than call by reference. No more disappearing values!

Though in all honesty, during the time it took me to remember these two very basic C wisdoms I really wished I was far far away from this planet.

Marianna - change degree before it's too late!

(hiho hiho off to teach I go)

At 5.10.05, Anonymous Anonymous said...

I'm worried about (b).... call by value is slow... and often isn't that useful as you can only return 1 value. And sending in strings means parsing them, which can get nasty for complex data structures.... Then again... whatever floats your boat :)

Working backwards, the best way to get around (a) is to avoid using C in the first place.

Sorry to be a pedant... I'll reply to your e-mails when I'm in a slightly more normal frame of mind :)

 
At 6.10.05, Anonymous Anonymous said...

You know what? I ENJOYED programming before I had to, I will change the major, natually, that's what I do, but I'll get it to run before anything else.
I just don't want to go through life with some validation error all over my forehead!

Hey Nir, you missed a ; once too, sorry for being a pedant!
Blame OKCUPID! I do, for everything.

 

Post a Comment