C Pointers - Good Tutorials [duplicate] - c

This question already has answers here:
Closed 13 years ago.
Possible Duplicate:
What are the barriers to understanding pointers and what can be done to overcome them?
Was just wondering if anyone could "point me" to a good tutorial on pointers
Would be very greatful
Thanks

The best start is Kernighan and Ritchie book of "Programming in C".

There is always Pointer Fun with Binky, produced by Stanford.

Well, http://pweb.netcom.com/~tjensen/ptr/cpoint.htm seems quite reasonable.

I like C for smarties a lot. It deals with many of the issues people face with pointers, is written by someone who knows C very well, and to paraphrase Einstein, doesn't simplify things more than they need to be. In particular, you should read "Are pointers numbers?", and "More on arrays and pointers" from the website.
Also, see comp.lang.c FAQ, sections 4, 5, 6, and 7.

While not related only to pointers, Defensive Programming is something that should definitely read up on and practice.It greatly reduces the number of mistakes that a programmer can mak
Here's a couple of nice links:
Dr Dobbs - http://www.drdobbs.com/cpp/184401915
Defensive C Programming - http://geofftop.com/Defensive_C_Programming.html

Read The C Programming Language by Brian Kernighan and Dennis Ritchie; it is excellent.

Related

difficulty in understanding how pointers work in c [duplicate]

This question already has answers here:
What are the barriers to understanding pointers and what can be done to overcome them? [closed]
(28 answers)
Closed 5 years ago.
I am learning c language for over a year now. But I still don't understand how pointers work. Can anyone suggest a good online resource to make concepts clear.
There is vast number of sources regarding C pointers. You can google for it. Try to read a few, one of them may just click.
Here just few which I like:
https://boredzo.org/pointers/
https://en.wikibooks.org/wiki/C_Programming/Pointers_and_arrays
https://users.cs.cf.ac.uk/Dave.Marshall/C/node10.html
https://en.wikipedia.org/wiki/Pointer_(computer_programming)
https://www.geeksforgeeks.org/function-pointer-in-c/
If you are clear with your concepts of pointers in one language, it would mean that you are clear in all possible programming languages as it is one of the most fundamental concepts.
Geeks for Geeks : More reliable source to clear basic concepts
https://www.geeksforgeeks.org/pointers-in-c-and-c-set-1-introduction-arithmetic-and-array/
Hackerrank is a good source for practical knowledge
https://www.hackerrank.com/challenges/c-tutorial-pointer/problem
Tutorials Point is yet another saviour
https://www.tutorialspoint.com/cprogramming/c_pointers.htm

Is "K&R C" still applicable [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I relearning C; it's been years and whilst familiar the nuances are lost in time.
I originally learned C from K&R. However, I now see many people levelling criticism at K&R.
A chief example is http://c.learncodethehardway.org/book/learn-c-the-hard-waych55.html#x61-27200055
Top reasons seem to be that it's code style is overly terse, practises aren't applicable in larger programs and lead to memory leaks or are subject to attack in shared network accessible systems.
Do people feel these criticisms are fair? Do they matter to somebody learning C? If so, could people recommend a "modern" C book, preferably available for Kindle?
As long as you're talking about the 2nd Edition, K&R is still very relevant.
In fact, I would say it's still the very best single book on C, both for learning, and for reference.
That said, you should also get a copy of Harbison & Steele's "C: A Reference Manual". It's the best current reference on C, and the Fifth Edition covers C99, which you should use if you can.
Also, once you've got a bit of C behind you, I'd strongly recommend reading "Expert C Programming", by Peter van der Linden.
It is still relevant and still very useful with regards to learning the language. Learning the language doesn't require you to implement new practices or styles that assist in code readability, etc.
For example, the idea of self documenting code is that you use verbose variable and function names to help explain the purpose of a function or a variable. K&R is clearly opposed to this. That doesn't mean you can't learn the C language from K&R, it just means that your style will need to be adjusted/updated based on whatever naming convention you decide upon in the future.
I cannot recommend "Expert C Programming" enough (as stated by gregj).

c pointers, Anyone got fundamental issues? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
What do people find difficult about C pointers?
New to c programming (Actually new to programming in general). Well, I just can't get familiar with c pointers. maybe, I can use them in some situations, but really am stuck to understand it. Anyone been in such a situation? Any suggestions?
I would start at the Introduction to pointers. The link is to a very simple, concise, and easy to follow tutorial/e-learning site. The next chapter goes more in depth. I think you'll find the information helpful in getting a better understanding of how pointers work.
That site discusses things that can confuse people easily. Such as the following syntax differences:
1 int *pnPtr; // a pointer to an integer value
2 double *pdPtr; // a pointer to a double value
3
4 int* pnPtr2; // also valid syntax
5 int * pnPtr3; // also valid syntax
Take a look at What do people find difficult about C pointers?. people discussed what fundamental issues they ran into when trying to learn c pointers.

Algorithm and data structure implementations for C programmers [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Are there any open source C libraries with common data structures?
What is the best source of algorithm and data structure implementations for C programmers? Links to an open source library or a book will do. (Please don't point to Sedgewick, as I already have his book).
Though I have not used GDSL ( Generic Data Structures Library ) I think it's worth considering as it implements many frequently used data structures.
The Algorithm Design Manual by Steven Skiena
(source: alberton.info)
Another C library worth checking out, especially because it hasn't been mentioned in answers to this question and also the other duplicate questions:
the C Algorithms Library, it can be found at http://c-algorithms.sourceforge.net/ and is covered by a BSD-style license, i.e. it can be freely used in any project. I've used it myself in several smaller programs without encountering any problems.
Art of Computer Programming, Volume 1: Fundamental Algorithms (3rd Edition)
http://en.wikipedia.org/wiki/The_Art_of_Computer_Programming

Trying to get started in C [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Does anyone know any good resources with tasks or problems to get practice in things that are "new" in C from the point of view of someone with experience in high-level languages like C# and PHP? All I can seem to find are more "challenges" than problems for practice.
Thanks.
K & R. [Kernighan & Ritchie]
http://www.amazon.com/Programming-Language-Prentice-Hall-Software/dp/0131103628/ref=pd_bbs_1?ie=UTF8&s=books&qid=1240539543&sr=8-1
You could try Thinking in C by Bruce Eckel.
It is completely free of charge, and is available for download from his website.
As others have said, read K&R.
Pay special attention to pointers, structs, unions, bit fields, typedefs, and the C preprocessor. Pointers and pointer arithmetic are very important.
Read the C preprocessor manual.
Learn to write makefiles. Read the manual for your version of make.
K&R is outdated.
I prefer C Primer Plus 5th Ed by Stephen Prata
ISBN: 0-672-32696-5
It covers C99.
This supposed to be C bible.
Problem Solving and Program Design in C
by
Jeri R. Hanly, Elliot B. Koffmon and Frank L. Friedman
Check out The Standard C Library by P. J. Plauger, from 1991. It alternates quotes from the standard (C89, I believe) with discussion of how the library functions were intended to be used, along with a fully described implementation of the complete C standard library. Source code is included as well.
Yes, the book hasn't been updated for the latest standard, but it still has a lot of value from explaining at least some of the rationale behind some of the oddities of the standard library. Incidentally, Plauger was on the standards committee.
Plauger wrote a number of the classic books on both C and early Unix. Track down and read the oldest for a taste of pre-C history...
Given your previous (C#) programming experience I guess you don't need a book that teaches how to program but the intricacies and subtleties of C. I'd recommend the following:
Prentice Hall - The ANSI C Programming Language 2nd ed. by Brian W. Kernighan and Dennis M. Ritchie. For basic questions.
Prentice Hall - Expert C Programming. Deep C Secrets.
ISO - C 99 Standard - final. Very useful for many doubts and questions
A source of problems to solve that have known answers is Project Euler.
It isn't itself C specific since there is a decidedly mathematical orientation to the problems as presented. However, making an honest attempt to solve a significant number of them would require a growing proficiency with structures, pointers, the standard library, and thinking about things in ways that work well in C.
Another resource that often seems to be overlooked is that MIT has been putting a large percentage of their curriculum online. Their EE/CS department is no exception.
The class Introduction to Algorithms might be one suitable choice. The textbook is Introduction to Algorithms, Second Edition, by Cormen, Leiserson, Rivest, and Stein which is reasonably well written as text books go. I didn't exhaustively search the course list, so I'm sure there are other gems in there as well.

Resources