Live data from Hacker News

Amiga C Tutorial (2022)

pjhutchison.org

1–10 of 39 posts

Re: Amiga C Tutorial (2022)

#2
This is the resource page I wished I had growing up. I learned it anyway, but in spite and henceforth poorly. Author should publish this content as a book. I'd buy it.

Re: Amiga C Tutorial (2022)

#5
Is it me or is there a bug with pointers on the bottom of http://www.pjhutchison.org/tutorial/pointers.html?

The author uses this code to dereference a pointer to a structure member:

    engine = *myvehicle->enginesize;
Unless I've forgotten 30 years of C experience, I'd expect this to be:

    engine = myvehicle->enginesize;
But it could be some peculiarity in the Amiga compiler.

Now I just wish I had the money to buy an Amiga when I was a kid :-)

Re: Amiga C Tutorial (2022)

#7
post #2

This is the resource page I wished I had growing up. I learned it anyway, but in spite and henceforth poorly. Author should publish this content as a book. I'd buy it.

I was about to comment the same! If teenage me in the 80's and 90's had this information instead of the AmigaBASIC book, I think my career would have been totally different. It would be several more years before I got my head warped by C/C++ in college.

Re: Amiga C Tutorial (2022)

#8
post #5

Is it me or is there a bug with pointers on the bottom of http://www.pjhutchison.org/tutorial/pointers.html ? The author uses this code to dereference a pointer to a structure member: engine = *myvehicle->enginesize; Unless I've forgotten 30 years of C experience, I'd expect this to be: engine = myvehicle->enginesize; But it could be some peculiarity in the Amiga compiler. Now I just wish I had the money to buy an Am…

No, this is a bug. The 'enginesize' data structure member is a float and not a pointer to a float.

Re: Amiga C Tutorial (2022)

#9
post #5

Is it me or is there a bug with pointers on the bottom of http://www.pjhutchison.org/tutorial/pointers.html ? The author uses this code to dereference a pointer to a structure member: engine = *myvehicle->enginesize; Unless I've forgotten 30 years of C experience, I'd expect this to be: engine = myvehicle->enginesize; But it could be some peculiarity in the Amiga compiler. Now I just wish I had the money to buy an Am…

Agree, it's broken.

It's also assigning string literals to char array struct members in a non-initializing context, which doesn't work.

As someone trying to piece together C knowledge from various b0rk3n tutorials (as a pre-Internet teenager in the early 90s) it's pretty provocative. Luckily I healed and levelled up since.

Post reply on HN