iamaboringperson wrote:
Re: Pointers in C
One problem I had when I started learning C, was understanding how functions worked. I could define them etc. however I treated function calls like 'gosub' or 'goto' in basic.
And also missed out on the joys of function pointers by which you could tell someone else where to goto!!
So, it seems that avoiding pointers is probably a good thing to do for beginners, but programming for the Amiga is riddled with pointers cos they're soooooo useful (especially on slower CPUs when passing large structs by value would be painful).
Another thing that came to mind is the problem of overflow. Since C is pretty close to the metal, it is necessary to know about the number of bits you have in your ints. It's not an arbitrary size and precision environment.
Ooooh, and endianism!!
Oh, and compiler optimizations that blow non volatiles out of your hardware banging code, and ... all sorts of good stuff.
Lot's of gotcha's in C/C++. Still great fun though.