console.device
14 messages in this thread
There must be standard routines for inputing data while using
console.device analogous to scanf. Can anybody help me out here? Thanks.
You can always do a buffered read and call sscanf to process the data. In
fact, you could create a routine called cscanf that does just that.
Thanks John, I'm trying to learn C and the Amiga at the same time and it's
quite a big chew. I've copied several examples from RKM.Lib&Dev as
practice, which isn't too bad but (naturally) some of their C style is
pretty advanced and consequently hard to follow. I have several books on
the subject but none walk ya through each step. It's especially frustrating
when the examples in RKM don't work [eg. Lines.c on pg 66 doesn't free mem
coretly]. I've stepped through Lines.c with Lattice codeprobe (CPR) and it
crashes on the second iteration of FreeMem
(BigOne->Plalnes[Loop],Rastersize); (two open).
Which RKM version? I know that the latest one is supposed to have had
extensive example testing by CATS. They like to keep track of these types of
problems.
It's ISBN 0-201-18187-8 Copyright 1990, I'm still running 1.3. BTW, is
there a C text that you recommend?
I just looked at the example and it appears to be correct in what it is
freeing. It is possible that something else is getting trashed in the
process. As for C books, Rob Peck's book – programming the Amiga in C is a
pretty good one.
I'm pretty sure that I copied it exactly, I've proofed a hard copy several
times, but I'll have another look. Thanks for the tip on
Peck's book.
Opps, just found a typo and Lines.c works fine….
Great. I am glad to hear that the example is ok. Feel free to continue
asking questions as you get into programming in C.
OK, thanks; it's kind of intimidating to have to ask such basic questions
from a past master of the subject. I origonally wanted to learn assembly
(following Transactor articles) realised that C is a necessity and only
found the time for it all now. I just plunked the new 2.x chip in a few
days ago and spent a lot of time getting the old (series I) SCSI to work
with the new chip. Now I'll have to get the new RKM's.
Ok, here's another piece of advice: Forget being "intimidated" and ASK
those questions. There are people on here who are really quite good at
using the language, lots of experience on this particular machine and all
that… and that experience is yours for the asking. If you don't ask,
you've just kicked yourself in the head for reasons only you will consider
worthwhile. No one here will think the less of you for asking anything…
we all started sometime, and I think you'll find that the vast majority
here remember those *very* painful days all too well. You'll get the help
you need 99% of the time, or we'll ALL learn something – and no one will
mind either way.
–Ben
There is nothing wrong with asking questions. The people at Commodore will
be the first to admit that I asked tons of questions (at least those who are
left). In my opinion, the only way to learn is to ask questions. I have a
co-worker that preceeds every conversation with me with 'I have a stupid
question…' and we go through the 'There's no such thing as a stupid
question routine' every time. Actually, we have both gotten to enjoy the
banter. Fortunately he continues to ask me questions (and they are starting
to get difficult).
What I really enjoy is questions that are real stumpers to think on. It
helps to keep the brain processes working.
I have a friend who talks and lunches with Don Knuth now and then. He is
working on the next volume, and in it, he includes several computing
problems he's dreamed up that should tax everyone's brain… my friend
tried to explain one, I think it went like this: take the set of all the
five-letter words in English. You can permute from one word to another by
changing one letter at a time. Find the shortest path between the words
"blood" "sweat" and "tears." (I think I've forgotten some twist on the way
you permute from one word to another…)
John,
There IS such a thing as a 'stupid question'. It's the one that DOESN'T
get asked.