help me learn C

E

ed

hi everybody am new to this group and help me to learn C

Have a look at this hello world program, make changes to it, make it
read some input, have a play :)

#include <stdio.h>

int main() {
printf( "Hello world\n" );
return(0);
}
 
N

noridotjabi

Help you learn C eh? That's quite the boon to ask. The C language is
extremely large containing numerous standard features and even more
nonstandard ones. One of the best C tutorials that I know of can be
found free online at:

http://www.cs.cf.ac.uk/Dave/C/CE.html

It assumes that you are using some sort of *nix system however all of
the information presented is still relevant (okay nearly all of it once
you get near the end some OS specific stuff is presented but its easy
enough to ignore this).
I read most of this tutorial and it help me to lean the basics and more
intermediate concepts of C. If you want to learn the really advanced
stuff the only way to really do it is to buy a book. Some online
tutorials present advanced information however it is often OS specific.
What's wrong with book anyway?
Nori
 
J

Joe Smith

[snip]
Please quote your context. There are dire consequences I've been told to
stop exaggerating if you don't.

If anyone had thought the question serious, then the answer might have
appeared before your shameless, self-promoting, commercial hyperlink. To
the extent that you think primes are are joke, it's on you. Joe
 
F

Flash Gordon

(e-mail address removed) wrote:

Provide context please. There is no guarantee that people can see the
post you are replying to. See the bits about posting from Google here
http://clc-wiki.net/wiki/Intro_to_clc
Help you learn C eh? That's quite the boon to ask. The C language is
extremely large containing numerous standard features and even more
nonstandard ones. One of the best C tutorials that I know of can be
found free online at:

http://www.cs.cf.ac.uk/Dave/C/CE.html

I can see a few problems just from looking at the page about basics. The
specification of the sizeof of integer types is wrong, an example
program calling printf without having first included stdlib (printf
*required* a prototype in scope because it takes a variable number of
parameters), it uses implicit int in examples which is a bad idea.
It assumes that you are using some sort of *nix system however all of
the information presented is still relevant (okay nearly all of it once
you get near the end some OS specific stuff is presented but its easy
enough to ignore this).

A lot of the information seems to be incorrect.
I read most of this tutorial and it help me to lean the basics and more
intermediate concepts of C.

In that case you will probably have to unlearn a number of things.
> If you want to learn the really advanced
stuff the only way to really do it is to buy a book. Some online
tutorials present advanced information however it is often OS specific.
What's wrong with book anyway?

I would recommend reading the comp.lang.c FAQ and buying a copy of K&R2
(see the bibliography of the comp.lang.c FAQ).
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc

Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
 
C

Chris Hills

Help you learn C eh? That's quite the boon to ask.

I can help you to use Usenet.

1 don't use the broken google interface to Usenet.

2 if you really muse use the broken google interface then set the reply
to quote the message you are replying to otherwise the vast majority of
Usenet users who use real newsreaders can not see what the hell you are
replying to.
 
R

Richard Heathfield

abhi said:
hi everybody am new to this group and help me to learn C

*THE* C book is:

The C Programming Language, 2nd Ed. Kernighan & Ritchie. Prentice Hall,
1988. ISBN 0-13-110362-8 (paperback), or 0-13-110370-9 (hardback).


http://c-faq.com/resources/index.html should be your first stop on the Net.


I hope you will also find this page useful:

http://www.cpax.org.uk/prg/portable/c/resources.php

It lists good books, Web tutorials, and other C resources that you should
find helpful in your quest to learn C.
 
C

Chris Hills

Richard Heathfield said:
abhi said:


*THE* C book is:

The C Programming Language, 2nd Ed. Kernighan & Ritchie. Prentice Hall,
1988. ISBN 0-13-110362-8 (paperback), or 0-13-110370-9 (hardback).

It is over 18 years old now. The language has moved on a long way since
then. The current C standard is about twice the size of the 1990 version

Also K&R is a language definition Much like a dictionary. Yiu do not use
a dictionary to learn to write novels or business reports.

Try the book review section at http://www.accu.org
 
A

ais523

abhi said:
hi everybody am new to this group and help me to learn C

If you want to learn C, a better newsgroup to try might be
<news:alt.comp.lang.learn.c-c++>.
 
P

pete

Chris said:
Richard Heathfield


It is over 18 years old now.
The language has moved on a long way since
then.
The current C standard is about twice the size of the 1990 version

Also K&R is a language definition Much like a dictionary.
Yiu do not use
a dictionary to learn to write novels or business reports.

K&R2 is not a definition of the language, but is a tutorial.

"This book is meant to help the reader learn how to program in C.
It contains a tutorial introduction to get new users started as soon
as possible."

The C standard is the definition of the language,
but is not a tutorial.
 
C

Chris Hills

If you want to learn C, a better newsgroup to try might be
<news:alt.comp.lang.learn.c-c++>.

That looks dubious.... The OP wanted to learn C not C-C++ is it similar
to C/C++?

when will people learn that C and C++ are separate languages.

The root of C++ is C90.

Since 1990 C has moved on and evolved to C99

C++ as also evolved and moved on from it's C90 root in a different
direction.

Even things that have identical syntax in a c and C++ may not behave the
same depending on if you use a C90, C99 or C++ compiler.
 
C

Chris Hills

[QUOTE="pete said:
Richard Heathfield


It is over 18 years old now.
The language has moved on a long way since
then.
The current C standard is about twice the size of the 1990 version

Also K&R is a language definition Much like a dictionary.
Yiu do not use
a dictionary to learn to write novels or business reports.

K&R2 is not a definition of the language, but is a tutorial.[/QUOTE]

Then it is a tutorial for a language of two decades ago that has been
greatly evolved since then.

Would you recommend someone looks at a book on MSC V 1 to learn current
MS VC?

Whilst many here did use K&R (1 and 2) to learn C when it did accurately
reflect the language it was a good book. I have a copy. However these
days you are far better getting a more modern book that addresses the
area you are programming in.

C on a PC is very different to C for an 8 or 16 bit MCU and whilst much
of C is portable the way you use it will depend on the platform and the
sort of application you are building. EG in many areas printf should
not be used.

There is not one single answer as to the best book to use to learn C.
Else you learn a ancient vanilla version of C that is not used in
practice.

That said there are many far worse books on C that are out there.
 
R

Richard Heathfield

Chris Hills said:
It is over 18 years old now. The language has moved on a long way since
then. The current C standard is about twice the size of the 1990 version

The current C standard, though, doesn't add a great number of significant
changes to the language that K&R2 describes. A great many of the additions
in C99 were to do with relatively esoteric mathematical operations that few
people care about. There are a few minor additions (BCPL comment syntax,
VLAs, compound literals, and the like), but these are of little moment. In
any case, some of these features are not supported (or not supported in a
conforming manner) by mainstream compilers.

Furthermore, even if you disagree that those features are relatively minor,
K&R2 remains a well-written introduction to the "core" of the language.
Also K&R is a language definition Much like a dictionary. Yiu do not use
a dictionary to learn to write novels or business reports.

Firstly, you appear to be ignoring the first seven chapters of the book (for
we will lay aside the eighth as being off-topic). Secondly, to take your
"novel" analogy, K&R2's purpose is not to teach programming, but to teach C
itself. It achieves this limited goal extremely well.
Try the book review section at http://www.accu.org

Well, I tried. I found an advertisement for movie reviews; another for "the
place to watch cinema and film reviews on your PC and shop online"; one for
MARK LOGIC, whatever that is; another for Amazon; and one for Blackwells.

When I used their search facility to look for "C", the first hits were: The
Complete C++ Training Course, Standard C++ IOStreams and Locales;
Exceptional C++; Borland C++ Builder 3 for Dummies; and Multi-Paradigm
Design for C++.

In fact, there were no C books in the first ten hits in the list. I didn't
look further. The average length of the reviews for the first ten books was
2.2 lines, or 19.9 words if you prefer.

It is possible that longer, more relevant reviews of C books are available
if you are prepared to register for the site, of course, but even if that
is true, it is not readily apparent from the material presented to those
who are /not/ registered, so there is little incentive to register. There
is also no indication of how much (if anything) it costs to register.

ACCU's usefulness appears to have taken a dive.
 
C

Chris Hills

Richard Heathfield said:
Chris Hills said:


The current C standard, though, doesn't add a great number of significant
changes to the language that K&R2 describes. A great many of the additions
in C99 were to do with relatively esoteric mathematical operations that few
people care about. There are a few minor additions (BCPL comment syntax,
VLAs, compound literals, and the like), but these are of little moment. In
any case, some of these features are not supported (or not supported in a
conforming manner) by mainstream compilers.

Furthermore, even if you disagree that those features are relatively minor,
K&R2 remains a well-written introduction to the "core" of the language.


Firstly, you appear to be ignoring the first seven chapters of the book (for
we will lay aside the eighth as being off-topic). Secondly, to take your
"novel" analogy, K&R2's purpose is not to teach programming, but to teach C
itself. It achieves this limited goal extremely well.


Well, I tried. I found an advertisement for movie reviews; another for "the
place to watch cinema and film reviews on your PC and shop online"; one for
MARK LOGIC, whatever that is; another for Amazon; and one for Blackwells.

Try

http://accu.org/index.php/book_reviews?url=search.xqy?field=subject&term
=beginner's+c

Ie do a subject search.

ACCU's usefulness appears to have taken a dive.

Yes... I am not impressed with the new interface.
 
C

CBFalconer

Buck said:
K&R2 is NOT a book for beginners.

On the contrary, it is ideally organized for beginners at C.
However it is probably not useful for those who have trouble with
"Dick and Jane, see Spot run".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,183
Messages
2,570,966
Members
47,514
Latest member
AdeleGelle

Latest Threads

Top