Back when I was a kid and was learning C, I used to wonder why people considered pointers hard.
My usage of pointers was like:
void func (int * arg1)
{
// do sth with arg1
}
int main ()
{
int x;
func (&x);
return 0;
}
I didn’t know stuff like malloc and never felt the need in any of the program logic for the little thingies I made.
Pointers are not hard. Memory management makes it hard.
Back when I was a kid and was learning C, I used to wonder why people considered pointers hard.
My usage of pointers was like:
I didn’t know stuff like
malloc
and never felt the need in any of the program logic for the little thingies I made.Pointers are not hard. Memory management makes it hard.
C makes them unnecessarily confusing in my opinion. In Forth they’re as simple as can be compared to C.