Welcome, Guest. Please login or register.

Author Topic: Mr. Biehl learns C  (Read 7324 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Generale

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: Mr. Biehl learns C
« on: April 07, 2005, 03:16:26 AM »
I did (most of) a bachelor of computer science, so I had to buy a _lot_ of prescribed textbooks. A fair few of them involved c/c++. I can tell you most books out there on the subject are useless, or a headache at best.

I came across teach yourself c++ in 24 hours on sale at the local angus & robertson. I usually hate the 'teach yourself' series of books, but this one is actually useful. If you see one floating around for a few dollars/euro/yen/drachma etc I'd say, grab it.

I'm going to go through it again, because it's been too long since I've done any programming. I don't even understand any of my old stuff.

You seem to be well on track though. Keep it up!
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline Generale

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: Mr. Biehl learns C
« Reply #1 on: April 07, 2005, 12:06:24 PM »
Pointers can also have other pitfalls, especially when your process is threaded or uses system global values. Essentially in any concurrent system dealing with I/O, external APIs or IPC.
If you are using pointers, there is no guarantee that the values of the data in the location will be the same as they were. Other threads/processes can change the values on you.

If you need the value to be the same as when you entered the function, you either need to stop your process from being pre-empted (varies between OSes), call by reference, or utilise some sort of semaphor or mutex.

I can't believe I know this stuff  :-o

Anyhow, if you're going to use linux/unix there are a lot of very nice, but non-ansi things to be aware of. By all means utilise them, but don't rely on them.

Assembler is still easy....just not MIPS RISC. Well, it's easy.....but time consuming. A lot like moving a mountain with a pair of tweezers, a grain at a time.

Anyway, yeah look out for the teach yourself c++ book. it's good value. When pointers and casting make my eyes glaze over, I look at that book.
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3