Learning C Programming Language

K

kaushal

Hi,

I am a newbie with no programming experience. How do i start learning
C understanding concepts and fundamentals.

Please guide

Regards

Kaushal
 
G

gaoqiang

Hi,

I am a newbie with no programming experience. How do i start learning
C understanding concepts and fundamentals.

Please guide

Regards

Kaushal

C and pointer
 
F

flebber

This book is excellent:-

http://en.wikipedia.org/wiki/The_C_Programming_Language

Unfortunately many on-line tutorials are very poor. This newsgroup has
a wiki (but I don't think it's updated too often)http://clc-wiki.net/


how is that helpful. It doesn't even make sense.

There is a whole video tutorials series here
http://www.wibit.net/curriculum/the_c_lineage/programming_in_c

Also there is some tutorials here http://www.cprogramming.com/tutorial/c/lesson1.html
And I have been finding this very helpful http://www.tutorialspoint.com/ansi_c/index.htm

Sayth
 
J

jacob navia

Le 31/10/11 05:33, kaushal a écrit :
Hi,

I am a newbie with no programming experience. How do i start learning
C understanding concepts and fundamentals.

Please guide

Regards

Kaushal

You download (at no charge) the C tutorial of the lcc-win
compiler.

http://www.cs.virginia.edu/~lcc-win32

You can download the compiler too, at the same address.

With that you have everything you need to
learn and use C.

You can ask any further questions in comp.compilers.lcc

jacob
 
A

August Karlstrom

I am a newbie with no programming experience. How do i start learning
C understanding concepts and fundamentals.

The book "C Programming: A Modern Approach" by K. N. King has been very
well received. Has anyone read it?


August
 
J

jacob navia

Le 31/10/11 11:37, Nick Keighley a écrit :
This book is excellent:-

http://en.wikipedia.org/wiki/The_C_Programming_Language

Unfortunately many on-line tutorials are very poor.

Maybe but that tutorial is really bad.

When explaining the control flow statements it would be nice to
mention (at least) break and continue... longjmp() should be mentioned
too.

The level of that tutorial is really bad, mostly cut/paste from
some man pages, without detailed examples, etc.

The tutorial I wrote tries to improve the quality of the material
presented but will never be mentioned in this group. To give an idea
of the scope of my work here is the table of contents:

1 Introduction to C
1.1 Why learn C?

1.2 Program organization
1.3 Hello
Program input 14
What are "function parameters"?
Console mode programs and windows programs
1.4 An overview of the compilation process
1.4.1 The run time environment
We wrote the program first
We compiled our design
Run time
1.5 An overview of the standard libraries

The "stdheaders.h" header
1.5.1 Passing arguments to a program
Implementation details
1.6 Iteration constructs
1.6.1 for
1.6.2 while
1.6.3 do
1.6.4 break and continue
1.7 Types
1.7.1 What is a type?
1.7.2 Types classification
1.7.3 Integer types
1.7.4 Floating types
1.7.5 Compatible types
1.7.6 Incomplete types
1.7.7 Qualified types
1.7.8 Casting
1.7.9 The basic types
1.8 Declarations and definitions
1.2 Standard type sizes in lcc-win
1.3 Increased precision numbers in lcc-win
1.4 Type sizes for lcc-win 64 bits
1.5 Minimum size of standard types
1.8.1 Variable declaration
1.8.2 Function declarations
1.8.3 Function definitions
1.8.4 Scope of identifiers
1.8.5 Linkage and duration of objects
1.8.6 Variable definition
1.8.7 Statement syntax
1.9 Errors and warnings
1.10 Input and output
1.6 File operations
1.10.1 Predefined devices
1.10.2 The typical sequence of operations
1.10.3 Examples
1.10.4 Other input/output functions
The current position
1.10.5 File buffering
Error conditions
1.11 Commenting the source code
1.11.1 Describing a function
1.11.2 Describing a file
1.12 An overview of the whole language
1.12.1 Statements
1.12.2 Declarations
1.12.3 Pre-processor
1.12.4 Control-flow
1.12.5 Extensions of lcc-win


2 A closer view
2.1 Identifiers.
2.1.1 Identifier scope and linkage
2.2 Constants
2.2.1 Evaluation of constants
Constant expressions
2.2.2 Integer constants
2.2.3 Floating constants
2.2.4 Character string constants
2.2.5 Character abbreviations
2.3 Arrays
2.3.1 Variable length arrays.
2.3.2 Array initialization
2.3.3 Compound literals
2.4 Function calls
2.4.1 Prototypes.
2.4.2 Functions with variable number of arguments.
Implementation details
2.4.3 stdcall
2.4.4 Inline
2.5 Assignment.
2.6 The four operations
2.6.1 Integer division
2.6.2 Overflow
2.6.3 Postfix
2.7 Conditional operator
2.8 Register
2.8.1 Should we use the register keyword?
2.9 Sizeof
2.10 Enum
2.10.1 Const.
Implementation details
2.11 Goto
2.12 Break and continue statements
2.13 Return
2.13.1 Two types of return statements
2.13.2 Returning a structure
2.13.3 Never return a pointer to a local variable
2.13.4 Unsigned
2.14 Null statements
2.15 Switch statement
2.16 Logical operators
2.17 Bitwise operators
2.18 Shift operators
2.19 Address-of operator
2.20 Indirection
2.21 Sequential expressions
2.22 Casts
2.22.1 When to use casts
2.22.2 When not to use casts
2.23 Selection
2.24 Predefined identifiers
2.25 Precedence of the different operators.
2.26 The printf family
2.1 The parts of a printf specification
2.2 Prototypes for the main functions of the printf family
2.26.1 Conversions
2.3 The conversion flags
2.26.2 The minimum field width
2.26.3 The precision
2.26.4 The conversions
2.26.5 Scanning values
2.4 The size specification
2.6 scanf directives
2.27 Pointers
2.27.1 Operations with pointers
2.27.2 Addition or subtraction of a displacement: pointer arithmetic
2.27.3 Subtraction
2.27.4 Relational operators
2.27.5 Null pointers
2.27.6 Pointers and arrays
2.27.7 Assigning a value to a pointer
2.27.8 References
2.27.9 Why pointers?
2.28 setjmp and longjmp
2.28.1 General usage
2.28.2 Register variables and longjmp
2.29 Time and date functions
3 Simple programs
3.1 strchr
3.1.1 How can strchr fail?
3.2 strlen
3.2.1 A straightforward implementation
3.2.2 An implementation by D. E. Knuth
3.2.3 How can strlen fail?
3.3 ispowerOfTwo
3.3.1 How can this program fail?
3.3.2 Write ispowerOfTwo without any loops
3.4 signum
3.5 strlwr
3.5.1 How can this program fail?
3.6 paste
3.6.1 How can this program fail?.
3.7 Using arrays and sorting
3.7.1 How to sort arrays
3.7.2 Other qsort applications
3.7.3 Quicksort problems
3.8 Counting words
3.8.1 The organization of the table
3.8.2 Memory organization
3.8.3 Displaying the results
3.8.4 Code review
3.9 Hexdump
3.9.1 Analysis
3.9.2 Exercises
3.10 Text processing
3.10.1 Detailed view
main
ProcessChar
ReadLongComment and ReadLineComment
ReadCharConstant
OutputStrings
3.10.2 Analysis
3.10.3 Exercises:
3.11 Using containers

4 Structures and unions
4.1 Structures
4.1.1 Structure size
4.1.2 Using the pragma pack feature
4.1.3 Structure packing in other environments
Gcc
Hewlett Packard
IBM
Comeau computing C
Microsoft
4.1.4 Bit fields
4.2 Unions
4.3 Using structures
4.4 Basic data structures
4.4.1 Lists
4.4.2 Hash tables
4.4.3 The container library of lcc-win
4.5 Fine points of structure use

5 Simple programs using structures
5.1 Reversing a linked list
5.1.1 Discussion
An improvement
Preconditions

6 A closer look at the pre-processor
6.1 Preprocessor commands
6.1.1 Preprocessor macros
6.2 Conditional compilation
6.3 The pragma directive
6.4 Token concatenation
6.5 The \# operator
6.6 The include directive
6.7 Things to watch when using the preprocessor
7 More advanced stuff
7.1 Using function pointers
7.2 Using the "signal" function

7.2.1 Discussion
longjmp usage
Guard pages
8 Advanced C programming with lcc-win
8.1 Operator overloading
8.1.1 What is operator overloading?
8.1.2 Rules for the arguments
8.1.3 Name resolution
8.1.4 Differences to C++
8.2 Generic functions
8.2.1 Usage rules
8.3 Default arguments
8.4 References


9 Numerical programming
9.1 Floating point formats
9.1.1 Float (32 bit) format
9.1.2 Long double (80 bit) format
9.1.3 The qfloat format
9.1.4 Special numbers
9.2 Range
9.3 Precision
9.4 Understanding exactly the floating point format
9.5 Rounding modes
9.6 The machine epsilon
9.7 Rounding
9.8 Using the floating point environment
9.8.1 The status flags
9.8.2 Reinitializing the floating point environment
9.9 Numerical stability
9.9.1 Algebra doesn't work
9.9.2 Underflow
9.10 The math library
10 Memory management and memory layout
10.1 Functions for memory management

10.2 Memory management strategies
10.2.1 Static buffers
Advantages:
Drawbacks:
10.3 Stack based allocation
Advantages:
Drawbacks:
10.3.1 "Arena" based allocation
Advantages:
Drawbacks:
10.4 The malloc / free strategy
Advantages:
Drawbacks:
10.5 The malloc with no free strategy
Advantages:
Drawbacks:
10.6 Automatic freeing (garbage collection).
Advantages:
Drawbacks:
10.7 Mixed strategies
10.8 A debugging implementation of malloc
10.8.1 Improving allocate/release
11 The libraries of lcc-win
11.1 The regular expressions library.
11.2 Using qfloats: Some examples
11.3 Using bignums: some examples

12 Pitfalls of the C language
12.1 Defining a variable in a header file
12.2 Confusing = and ==
12.3 Forgetting to close a comment
12.4 Easily changed block scope.
12.5 Using increment or decrement more than once in an expression.
12.6 Unexpected Operator Precedence
12.7 Extra Semi-colon in Macros
12.8 Watch those semicolons!
12.9 Assuming pointer size is equal to integer size
12.10 Careful with unsigned numbers
12.11 Changing constant strings
12.12 Indefinite order of evaluation
12.13 A local variable shadows a global one
12.14 Careful with integer wraparound
12.15 Problems with integer casting
12.16 Octal numbers
12.17 Wrong assumptions with realloc
12.18 Be careful with integer overflow
12.18.1 Overflow in calloc
12.19 The abs macro can yield a negative number.
12.20 Adding two positive numbers might make the result smaller.
12.21 Assigning a value avoiding truncation
12.22 The C standard
12.22.1 Standard word salads
12.22.2 A buffer overflow in the C standard document
Getting rid of buffer overflows
Buffer overflows are not inevitable.
The attitude of the committee
12.22.3 A better implementation of asctime

13 Bibliography
Appendices
.1 Using the command line compiler
 
B

Ben Bacarisse

jacob navia said:
Le 31/10/11 11:37, Nick Keighley a écrit :

Maybe but that tutorial is really bad.

What is "that tutorial"? Your reply is to a link about the book -- and
the book has a very good tutorial.

<snip>
 
S

Seebs

The book "C Programming: A Modern Approach" by K. N. King has been very
well received. Has anyone read it?

Yes. Full disclosure: I also did a technical review pass on the second
edition.

I love it. I think it is a better way to learn C than K&R, and I do not
say that particularly lightly.

-s
 
F

Frederick Williams

kaushal said:
Hi,

I am a newbie with no programming experience. How do i start learning
C understanding concepts and fundamentals.

Think of a problem that can be solved by programming and solve it using
C. As well as K&R, Harbison & Steele might be useful.
 
T

tea strainer

jacob said:
Le 31/10/11 05:33, kaushal a écrit :
Hi,

I am a newbie with no programming experience. How do i start learning C
understanding concepts and fundamentals.

Please guide

Regards

Kaushal

You download (at no charge) the C tutorial of the [snip] compiler.

[commercial advertisement snipped]

You can download the compiler too, at the same address.

With that you have everything you need to learn and use C.

Give it a rest, spammer.

Your unsolicited commercial messages are not welcome here.

In any case the OP probably wants to learn Standard C, not your erroneous
non-conforming dialect.
 
J

jacob navia

Le 31/10/11 22:16, tea strainer a écrit :
http://www.cs.virginia.edu/~lcc-win32



Your solicited messages are welcome here.

In all cases the OP wants to lcc-win, not your boring
conforming dialect.


Thanks anonymous coward. It is a pleasure to notice you again,
having a spammer that feels necessary to answer all my messages
is a big boost to my humble ego.


Please go on...

:)
 
N

Nick Keighley

Le 31/10/11 11:37, Nick Keighley a écrit :



Maybe but that tutorial is really bad.

K&R? Atre you serious. I know you're a wally that thinks he's a genius
but this takes the biscuit.
When explaining the control flow statements it would be nice to
mention (at least) break and continue... longjmp() should be mentioned
too.

The level of that tutorial is really bad, mostly cut/paste from
some man pages, without detailed examples, etc.

The tutorial I wrote tries to improve the quality of the material
presented but will never be mentioned in this group. To give an idea
of the scope of my work here is the table of contents:

        1       Introduction to C
        1.1     Why learn C?

<snip spam>
 
B

Bill Reid

K&R? Atre you serious. I know you're a wally that thinks he's a genius
but this takes the biscuit.
Mate, go soak yer head in the billybong...K&R sucks for learning
how to program in "C" for a rank novice, and I should know, because
I tried to use it several decades ago for that purpose, and made
no headway until I threw it away and got another book, which
wasn't great, but just about anything is better than K&R...

What I'm detecting here is a concept I call "books written
by 'technical experts' for 'technical experts' for the sole
purpose of perpetuating 'technical expertise'". I use the
sarcastic quote marks around 'technical expertise' because
the real goal is apparently to create as much confusion
as possible so when management comes around and asks why
nothing has happened the 'technical experts' can spout a
bunch of carefully scripted gooble-de-gook as an excuse...
You know, you would think completism would be the sole
virtue of the book, but noooooooooo...
The real problem is that "example is not explanation"; the
book explains nothing but merely presents random snippets of
code and let's the reader puzzle it out for themself...
<snip spam>
Yeah, I began a book many years ago to REALLY explain "C"
to non-programmers; suffice is to say my table of contents
was subtansially different than the typical "C" book, because
it was written with the basic premise that "C" was developed
as hateful prank against everybody in the world who got laid
more than Kernighan and Ritchie in high school...

Aside from that, my goal was to first simply explain basic
computer science and general programming concepts (which
is a missing prerequisite in many purported "beginner"
programming language books), and THEN to EXPLAIN the
basic concepts of "C" compiling protocols, and so forth...
 
J

jacob navia

Le 01/11/11 22:52, John Gordon a écrit :
Jacob,

Why did you respond to the link to
http://en.wikipedia.org/wiki/The_C_Programming_Language

by saying "that tutorial is really bad", when you were actually referring to
this link:

http://en.wikibooks.org/wiki/C_Programming

It's a completely different website (wikibooks.org vs. wikipedia.org).

Because I did a mistake in the "reply to" probably. In any case it is
completely impossible to imply that in the book of K&R you will find

<quote>
When explaining the control flow statements it would be nice to
mention (at least) break and continue... longjmp() should be mentioned
too.
The level of that tutorial is really bad, mostly cut/paste from
some man pages, without detailed examples, etc.
<end quote>

I was obviously speaking about something else as I clarified to Ben
Becarisse two days ago in this same thread.

But even if I repeat that, nothing matters, I will be flamed for
claiming that K&R is a bad tutorial when I have it in the Biliography
section of my tutorial!
 
N

Nomen Nescio

Seebs said:
Yes. Full disclosure: I also did a technical review pass on the second
edition.

I love it. I think it is a better way to learn C than K&R, and I do not
say that particularly lightly.

Ok but over 800 pages for a book on C? Isn't that a little excessive?
 

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
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top