Bill Cunningham said:
The results I got from your first program was a warning concerning no
newline character
You didn't get this warning when you ran it - you got it when you
compiled it. This is because your text editor does not end the final
line of the file it creates with a newline character. To eliminate
this warning (which merely adds noise to the compiler's output,
reducing the visibility of the messages you _should_ worry about) you
should ensure that each source file, when displayed on screen in your
editor, has an "extra" blank line at the end. (Any number of extra
blank lines at the end should make no difference to your code so feel
free to tap the Enter key a couple times after the final '}'.)
Perfect. Keep that program around (I recommend you save each answer
in an appropriately-named file, in this case "q1.c", for later
reference and review) and a little way down the track you will have
the knowledge to analyse _why_ that output is produced, when the
string "test 1" appears nowhere in the source.
Here is the answer to #2 of your question.
#include <stdio.h>
int main(void) {
printf("hello world\n");
return 0;
}
(with '!' added in a later post)
Close enough for jazz.
(While it's not vital for this example, remember that UPPER CASE and
lower case are distinct, both in C keywords and identifiers, and also
within strings. If you care enough to correct the missing '!', you
should also ensure case distinctions are preserved.)
Do you wish to correspond through private email ?
No - you owe it to the group to demonstrate the learning process
publicly (since you've previously wasted a lot of their time flailing
around), and as they see you improving may even be motivated to help.
Take that help in the spirit in which it is offered and everybody
wins.
I will post the answer to your third question later.
I look forward to it - you've made a good start and I'd like to see
you keep it up. (Analogous to "q1.c" above, save the 2 programs in
"q3a.c" and "q3b.c", and then paste them direct into your posting.)
Once we've dealt with each group of questions, I'll prepare a few
more, each building on what we've done previously. If at any stage
you don't understand something, I'll need you to describe what parts
of it you _do_ understand so I know what base I can build a new
explanation on. If you claim to understand (e.g. by not saying
otherwise) but actually don't, then your confusion will only deepen
because each part depends on what has come before.
mlp