On Fri, 06 Nov 1998, Glynn Clements wrote:
>Ken wrote:
>
>> > void main()
>> 
>> DOH! DOH! DOH! DOH! If the book you have claims to teach "ANSI C",
>> burn it.
>> 
>>  int main()
>
>As we're on the ANSI C track, that should be
>
>       int main(void)
>or
>       int main(int argc, char **argv)
>or
>       int main(int argc, char **argv, char **envp)
>
>> Just type in "info" and follow the instructions are the top
>> of the screen. Info isn't the easiest thing to learn to use
>> but it is well worth it in the long run. I use to be a man
>> page bigot until I took the time to learn Info. 
>
>To read Info files, use `C-h i' in (X)Emacs. The standalone Info
>reader is really poor.

No argument here, but for non (X/Lucid/whatever)Emacs users, tkinfo is very
nicely done -- perhaps even Emacs users should check it out for info files.

I won't give out an ftp site or url as both tkinfo and tkman are available all
over the place (use archie, deselect (Debian users), or perform a web search
for God's sake).

For the newbie who started these questions, the fact that you are having such
trouble learning C likely means that you don't yet grasp fundamental
programming knowledge.

The following are important notions to wrap your head around before undertaking
a large programming task -- and perhaps before blowing your wad on another 
pricey C book:

Build procedure.
-Prepocessor -- what it's useful for and what it shouldn't be used for.  
-Compiling -- building object files
-Linking -- a basic idea, yet surprisingly misunderstood by many.  (don't
concern yourself with shared vs. dynamic libs yet)

Program Flow
-program counter -- points to next instruction to be executed (a machine
instruction, but carries over well to a C instruction).  One must understand the
incremental (or discrete) execution of a program.
- threads, processes, mutli-threading, multi-programming, multi-tasking --
these topics will become more important as your programming advances.

Storage
Data Types:
a data type is just storage (virtual memory) with some interface for I/O
-Arrays, linked lists as well as the standard data types (int , char ...)
-Allocating memory -- dynamically (via malloc family) or on the stack.
The Stack:
-understand it's operation (FIFO) and it's storage of local variables
Memory/Disk/Files/Network...
-these are obviously not the same, but you should think of them in terms of
I/O, rather than as physical entities.

Scope
-Namespaces, Globals, Constants, #defines, extern, static, auto, register ... , 
This is incredibly confusing to a beginner.  Because there are many ways to
pollute a namespace.  When working with several source files (or modules), this
becomes even more hairy.

General
-Implementation vs interface (or declaration) for variables and functions
-platform indepent and dependent coding -- an important distinction
- many other....

It is a more intuitive (for myself anyway) and more practical to stress the
above topics rather than pushing syntax and half-assed examples like most C
books out there.    

Anyway, I couldn't give all of the topics that I listed (and many that I left
out) as much justice as others on this list (like that British fellow Glynn). 
So I'll just put those topics out there for you to look at and perhaps hope
that someone knows of a more practical book/document that touches on these
issues.

Andrew  

Reply via email to