Re: beginner c questions




"matt" <mweppler@xxxxxxxxx> wrote in message
news:1130985194.199825.23570@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> You should read the reviews at www.accu.org for which I gave
>> the link in another message in this thread. Surprisingly to
>> me, the book I'd recommend isn't listed there: Kernighan
>> and Ritchie, "The C Programming Language" Second Edition.
>> It's the one I learned with, oh so many eons ago. :-)
>> Also don't feel you should restrict yourself to a single
>> book. Often seeing the perspectives of different authors
>> about the same subject can help greatly.
>>
>>
>> -Mike
>
> I actually have Kernighan and Ritchie, "The C Programming Language"
> Second Edition.

Good. Keep it.

> I started with it but I felt it was asking me to write
> c without teaching it first.

It 'teaches as it goes'. But I must admit it is
quite concise. But all the info is there.

> As an example in the first chapter it asks
> you to print EOF, it doesnt even explain how anywhere

You need to 'put the pieces together'. EOF is explained on
page 16.

How to print an integer is explained on page 11 (also see
page 13).

(page numbers might not be exact if your book doesn't have
same printing date as mine, but should be close).

Were you successful with the "Hello world" program?

> so how can I move
> forward.

Go slowly. Read and reread, carefully. Experiment.

Anyway, here's how to print the value of EOF:

#include <stdio.h>

int main()
{
printf("%d\n", EOF);
return 0;
}

> I purchased the book I have now from me girlfriends college
> figuring since they sell it in the school it would be helpful.

You should probably hang on to it. It could be useful later.

>I really
> dont know where to go next, I do have php programming experence but am
> not finding it helpful with these questions at all.

Forget about PHP when learning C. It's enough different from C that it will
probably only cause confusion.

-Mike




.



Relevant Pages

  • Re: Article about HLA on Linux Journals website
    ... HLA is an assembly language, although one might be able to write a few ... > this is batch programming and not assembly programming. ... > goto:eof ...
    (alt.lang.asm)
  • Re: Missing EOF
    ... >> Some files I must process have a EOF and some files don't. ... > AFAIK files don't really contain an EOF at their end. ... > used in programming to allow the programmer to know that a file ... I believe he's really asking for a way of adding a final newline ...
    (comp.unix.shell)
  • Re: read input from beginning at eof?
    ... I am new at awk (and programming in general) and would greatly appreciate ... I am writing a code that needs to read through an input file ... Is there a way so that once the program reads to the eof of the ... it into and array and then read the array as many times as needed. ...
    (comp.lang.awk)
  • read input from beginning at eof?
    ... I am new at awk (and programming in general) and would greatly ... I am writing a code that needs to read through ... an input file 49 times. ... Or maybe once it reaches the eof it could set ...
    (comp.lang.awk)