Hacker News new | ask | show | jobs
by archfrog 1009 days ago
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 :-)

3 comments

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.

Reminds me a bit of the "Mastering C Pointers" book that was popular in the early 90s and contained a multitude of outright errors.

https://wozniak.ca/blog/2018/06/25/1/index.html

You might have the money to buy an Amiga now?

https://retrogames.biz/products/thea500-mini/

Fact is, with a little LCD and a nice keyboard, one could put the Amiga in the 'loo and have a fair bash at the old school while pushing one out, eh .. ?

/oric_telestrat_forever

An "A500 Mini" is basically the same emulator you could get for basically free, plus a case which is reminiscent of the actual Amiga A500, bundled with some video games.

Probably if you are interested in writing software for an Amiga, rather than nostalgia of old video games you might better begin with just the emulator.

Okay, hear me out .. sure, you could do all this with another system too, if you had them available, but this is a pretty decent implementation, in hardware.

You can boot it into a 'proper' A1200 and use it just like that, as a pretty decent little Amiga system - one doesn't have to only run the built-in OS/provided games, you know.. you can boot it like an Amiga would, albeit with USB.

With the distinctly relevant advantage that a) it is a small and compact, unassuming device .. and therefore can be duct-taped to the back of the LCD monitor[1] that has, inevitably, a 'spare' video input, and b) one doesn't have to install anything on your other .. potentially work-provided .. computer .. which you occasionally switch back to, when the cubicle alarm goes off ..

I mean, I use my raspberry-Pi for productive things. Having an Amiga handy here and there, has been great. Even the conference room monitor has extra inputs and some spots for duct-taping ..

[1] or underneath the desk, in the cabinet, whatever ..

>but this is a pretty decent implementation, in hardware.

minimig mist branch is a decent implementation in hardware.

The A500 mini is an open source SOFTWARE emulator (amiberry, designed for the raspberry pi) put in a much cheaper/weaker board relative to the pi, enclosed by a nostalgia-inducing box, and sold at a very profitable price.

There's nothing good I can say about it.

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