On Fri, 6 Nov 1998, Enki wrote:
> #include <stdio.h>
> #include <conio.h>
^^^^^^^^^^^^^^^^^^^
That header is specific to a nasty little obsolete operating
system.
> void main()
DOH! DOH! DOH! DOH! If the book you have claims to teach "ANSI C",
burn it.
int main()
> ch=getche();
Not an ANSI library function, therefore no guarantee that
it is portable.
> Like I said I'm learning C
> in fact I've been try to learn C for two year now
> But all the books I've tried before sucked or taught nothing but
> how to type in a program
There really isn't a lot to learn about the C language when compared
to some other languages.
Learning the C language and learning how to program, are for all
purposes, to totally different tasks. Learning how to use the
various APIs other than the standardised ANSI C functions is a
different matter also.
> when I was using macOS I tried about five different books for the Mac
> and they all seem to want to teach how to type in their code for their
> ideas and then they don't tell you what is what.
How typically Macintosh :-(
> Now I have C for Dummies and I feel very comfortable with playing around
> with the programs and I have even written a frame work in C of some of
> the programs I wrote a long time ago for the Apple II.
Those "Dummies" books are lame. They take 10 pages of text and
pad it out to make a book or two. There are much better books
around, have a look at the comp.lang.c FAQ. Use a search engine
if you aren't find it (like http://www.yahoo.com.)
Avoid all and any books by Herb Schildt too, everything he writes
is total bullshit.
> Now for the Q's how do you know where a function might be and how a
> certain Function works. I Just finished looking through curses and
> ncurses and it looked like there are some graphix hacks that I NEED to
> play with!!!!!!!! ;D
Under Linux there are the man pages and the info pages. They
are generally stored in "/usr/man/" and "/usr/info".
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 use man type in "man %# %x" where "%#" is the man section
to look in, and "%x" is the name of the man page. Examples:
"man 1 man", gives you the manual page for the man program.
"man 3 malloc" gives you the manual page for the malloc function.
Forget curses until you know the C language and the ANSI functions.
One of the things some people get caught up in is system specific
details like how do to get unbuffered input and how to move the cursor.
Until you master the standard ANSI library, the C language and how to
design a program, knowledge of such specifics doesn't help you. If
anything it hinders progress.
If you are really struggling with the basics of C and would like
some help, and don't mind me using your questions for the basis of
a text I'm working on, feel free to email me.