Atheist wrote:
I don't know what you mean by the extra memory. Amos worked when I only had chip ram, and it worked when I got both. I don't have the compiler thogh, but am getting it soon. I know it's free, but I found a store that had it on the original disks, and am waiting to see if it's still available. (Professional Comp)
Are you saying that when Amos Professional, compiles a program, it won't work on what 020, 030...?
Basically, my experience of AMOS has not been a good one. Any Amos program I've ran, be it old custom-chip hacky game style or intuition friendly has fell over at the slightest provocation.
This has been the case on at least three accelerated systems I used (030, 040 and 040/PPC). And yes, one program that used to work in 16Mb 70ns ram crashed continually with 64Mb 60ns ram. Maybe the speed was too much for it, but I don't know. When the machine just restarts on you, you don't get much debug info ;-)
-edit-
Anyhow, me old mate, back to C (neary forgot to answer your other questions)
First off, the first string argument passed to the C main() function is indeed the program name. You didn't misread that.
As for argv, you could indeed have changed the name to 'word' or whatever you wish, just as long as you use the same name in the code, eg
int main(int numberOfArguments, char* argumentString[])
{
/* use numberOfArguments and argumentString
somewhere in here*/
}
would be perfectly OK. It's just that 'argn' and 'argv' are kinda conventional.
As for output, I did use puts() and printf(). There is a reason for this.
Basically puts() is your no-frills console output command that writes a string, complete with a newline ('\n') character on the end. Thats all it can do.
The other function, printf() is a complex beastie that can print formatted strings (hence the 'f' in printf).
Going into the detail of formatted output would take ages. But, just to give an idea:
The string we pass to printf() can embed special codes, prefixed with a percent sign. When the printf() function finds one of these, it substitutes it with the corresponding argument. For example
printf("An integer : %i\nA float : %f\n", 10, 5.5);
should produce the following
An integer : 10
A float : 5.5
as output. There are options that pad, justify, enforce sign, notation conventions etc.
As a final point, printf() doesn't stick a newline on the end of a string by default like puts() does, so you'll see I had to stick the '\n' character in the string myself.