
Learn C in Minutes - Ashuu
http://learnxinyminutes.com/docs/c/
======
tater
Learning C takes a bit more than learning than its syntax. Feeding someone
this and telling them they now know C is a recipe for disaster. The "Best to
find yourself a copy of K&R" line is the only line that should be there.

~~~
kryten
I was brought up on K&R. I wouldn't recommend it for anyone anymore. Much like
a Java certification, most of it will have to be unlearned in real life. It's
littered with holes and land mines and misses a massive chunk of the
surrounding tooling and all the idioms which make for a good C program that
won't kill you or your immediate successor who has to maintain what you've
written.

I'd go with Zed's Learn C The Hard Way, then 21st Century C and go from there.

~~~
Keyframe
Zed made a really good intro to C. I was surprised. My only issue with it was
he introduced readers to bstring instead of something UTF, but still better
than vanilla chars. I wouldn't even know an UTF library for C with permissive
license and lightweight on top of my head. C coding is all about memory
management and data structures layout.

~~~
kryten
Agree but Unicode is a rather complicated diversion. In a lot of circumstances
it's not really required as well. It's definitely a reading on subject.

Also, bstr stops a lot of simple tasks looking impossible and therefore
motivates people.

Further to that, if you consider Java, Python, C# etc, you're using massive
libraries at a very high abstraction level and it is considered normal. There
isn't anything built into C like that.

~~~
Keyframe
I agree completely with you on all counts. He didn't made a wrong choice with
bstrlib by far. I just felt there was a strong movement in recent years to
move towards utf in general, so why not expose beginners to it as well, just
as a part of overall strategy. It's not a trivial issue to tackle though for
sure.

------
4ad
> chars are guaranteed to be 1 byte

No they are not, assuming a byte as defined in ISO/IEC 80000-13 (8 bits, the
most common accepted definition). In fact other types are defined in terms of
the size of char, and sizeof(char) is always 1 by definition. These are not 8
bit bytes though. Some machines don't have byte addressing, for example DSPs.
CHAR_BIT will tell you how many bits are in a char.

~~~
TheCoelacanth
> assuming a byte as defined in ISO/IEC 80000-13

C uses a different definition of byte. The C standard defines the size of a
char as 1 byte.

~~~
4ad
What is defined as a byte in the C standard is irrelevant to this article. A
person reading this awful article(?) hoping to learn C wouldn't be aware of
the C-standard definition precisely because he doesn't know C! He would only
be familiar with the common definition of 8 bit bytes. ISO/IEC 80000-13
defines 8 bit bytes precisely because this is the common definition.

~~~
TheCoelacanth
If you are going to use the common definition instead of the C-standard
definition, why not use the common implementation characteristics of C as
well? A char is one byte both in the context of the standard and in the
context of common usage. It's only when you mix the two contexts haphazardly
that the two aren't the same size.

------
joshguthrie
How do I run my C code?

How do I pass commands to my app?

How do I read/write a file?

What is a "compiler?

What is "the preprocessor"?

What is "linking"?

What is a "linked list"?

What is a "Makefile"?

What are "C89" and "K&R"?

What are those strings in ALL_CAPS?

Why is there a segfault and where is it coming from?

Why does printf() wait to display stuff not ending with "\n"?

------
anuragramdasan
I have seen the similar doc for python and that seemed very interesting and
would've been a great resource for any beginner, but I wonder if such a format
would work for C programming. Being able to actually make up in C would take a
lot more effort than just that I would say.

But yes, a great effort nevertheless.

~~~
deletes
This is more of a "cheat sheet" that a learning resource. For a complete
beginner this has no value. To learn c, minutes are a 3-4 digit number.

I would recommend C Programming: A Modern Approach (Second Edition). It is
pretty much an updated K&R for C99.

------
level09
love the idea, would be cool if this can be extended like :

\- play with youtube api in 5 minutes \- learn how to integrate
Facebook/twitter oauth in minutes \- create a flask/monogodb API in 20 seconds

etc ..

~~~
icpmacdo
I'll start working on some :)

~~~
adambard
In every language?

------
octo_t
Comments starting with // are not valid C89.

~~~
EpicEng
Why should tutorials cater to a spec which was ratified over twenty years ago
and has been superseded by two subsequent standards? Sure, VS only supports
C89... but anyone writing serious applications in C avoids VS if at all
possible anyway.

As an aside, even VS allows // comments.

