Good place to start learning C?

You can talk about almost anything that you want to on this board.

Moderator: Moderators

Termingamer2-JD
Posts: 14
Joined: Sun Sep 20, 2015 5:44 am

Good place to start learning C?

Post by Termingamer2-JD »

Where's a good place?

I don't always trust search engines because their results are done via SEO, not by user feedback, where could you recommend is a good place to get a C programming tutorial in full on the web?

If it's a downloadable file (PDF, DOC, etc) it's allowed. I'm using XP SP3 if it means anything, so it needs to work on there.

Thanks,
Termingamer
User avatar
Memblers
Site Admin
Posts: 3901
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Good place to start learning C?

Post by Memblers »

https://en.wikipedia.org/wiki/The_C_Pro ... g_Language

If you add the term PDF to the book title in a seach engine, you should have no trouble finding a copy of it.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Good place to start learning C?

Post by rainwarrior »

I learned from this book a very long time ago: http://www.free-engineering-books.com/2 ... using.html

I don't really remember if it was a good or bad book, but it was certainly enough to get me started. Once you get the basic ideas down, the real way to learn is to write programs, and especially: read programs written by others.
User avatar
Dwedit
Posts: 4470
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Good place to start learning C?

Post by Dwedit »

Better yet, modify someone else's program. Change something.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Termingamer2-JD
Posts: 14
Joined: Sun Sep 20, 2015 5:44 am

Re: Good place to start learning C?

Post by Termingamer2-JD »

I need to be able to code stuff to change something though...

And yeah, I'll go and look into those later. At the moment I don't have much time.

Thanks.
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Re: Good place to start learning C?

Post by Bregalad »

Memblers wrote:https://en.wikipedia.org/wiki/The_C_Pro ... g_Language

If you add the term PDF to the book title in a seach engine, you should have no trouble finding a copy of it.
Not really great advice, the book is extremely old and sometime shows things that turned out to be bad practice in the language. I'd say by all means use the book, but not only that book, use it as one among other resources to learn C.
Better yet, modify someone else's program. Change something.
Horrible advice. If you cannot write your own hello world program from the ground up, you'll never be getting anywhere, seriously.

As for my own advice, well I'd use books, there is literally thousands for learning C. You could also use websites, if you prefer. I think the advantage of paper books is that you can read them and do some exercises without using a computer, and that's kind of nice, since you'll already have to sit hours in front of your PC to try to code something and debug your code.
User avatar
Zepper
Formerly Fx3
Posts: 3264
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Good place to start learning C?

Post by Zepper »

C is nothing without a compiler.
User avatar
Sogona
Posts: 186
Joined: Thu Jul 23, 2015 7:54 pm
Location: USA
Contact:

Re: Good place to start learning C?

Post by Sogona »

Why is it that the compiler seems to be the ugliest part of any programming language?
Termingamer2-JD
Posts: 14
Joined: Sun Sep 20, 2015 5:44 am

Re: Good place to start learning C?

Post by Termingamer2-JD »

It's not just the Hello World program that counts, it's whether you understand it or not, I think.
Of course, I haven't a position to say that but really, just copy/pasting isn't coding, learning is doing your own mods to the stuff and write the code.

Also, I have a couple of questions about the development of the emulator in my 'first things to do for an nes emulator' thread, regarding what to use C for in there...

I'd need to use assembly in places, for TerminNES.
User avatar
Sogona
Posts: 186
Joined: Thu Jul 23, 2015 7:54 pm
Location: USA
Contact:

Re: Good place to start learning C?

Post by Sogona »

Termingamer2-JD wrote:It's not just the Hello World program that counts, it's whether you understand it or not, I think.
Of course, I haven't a position to say that but really, just copy/pasting isn't coding, learning is doing your own mods to the stuff and write the code.

Also, I have a couple of questions about the development of the emulator in my 'first things to do for an nes emulator' thread, regarding what to use C for in there...

I'd need to use assembly in places, for TerminNES.
What I've learned through a couple computer science courses is that pretty much every high level language is the same. If statements, if-else statements, for loops, while loops, switch statements, primitive data types, condition testing, etc. It's all pretty much exactly the same. So if you know how to make a "Hello World" program in c, you should pretty much know how to do it in Java, C++, C#, Python, etc.
User avatar
Bregalad
Posts: 8036
Joined: Fri Nov 12, 2004 2:49 pm
Location: Caen, France

Re: Good place to start learning C?

Post by Bregalad »

What I've learned through a couple computer science courses is that pretty much every high level language is the same. If statements, if-else statements, for loops, while loops, switch statements, primitive data types, condition testing, etc. It's all pretty much exactly the same. So if you know how to make a "Hello World" program in c, you should pretty much know how to do it in Java, C++, C#, Python, etc.
It's not pretty much every high level language which is the same, it's pretty much every imperative languages. Some high-level non-imperative languages are indeed very different.

Also, the point of an hello world is not to use if or while statements (they are notmally not found in a "hello world" type program) but just to have some basic syntax ready for a program.
Termingamer2-JD
Posts: 14
Joined: Sun Sep 20, 2015 5:44 am

Re: Good place to start learning C?

Post by Termingamer2-JD »

Ah. I see the point now you explained it, I just saw it as a simple test thing, thanks.

Probably tonight I'll be studying C using what has been linked to in NESdev :)
User avatar
Sogona
Posts: 186
Joined: Thu Jul 23, 2015 7:54 pm
Location: USA
Contact:

Re: Good place to start learning C?

Post by Sogona »

Bregalad wrote:
What I've learned through a couple computer science courses is that pretty much every high level language is the same. If statements, if-else statements, for loops, while loops, switch statements, primitive data types, condition testing, etc. It's all pretty much exactly the same. So if you know how to make a "Hello World" program in c, you should pretty much know how to do it in Java, C++, C#, Python, etc.
It's not pretty much every high level language which is the same, it's pretty much every imperative languages. Some high-level non-imperative languages are indeed very different.
I figured it was a given that languages of different paradigms are different. But yes, something like Lisp is very different from somehing like C.
User avatar
mikejmoffitt
Posts: 1352
Joined: Sun May 27, 2012 8:43 pm

Re: Good place to start learning C?

Post by mikejmoffitt »

K&R's "The C Programming Language" as Memblers recommended is a great place to learn C from.

I'm in support of DWEdit's advice to modify another program for the sake of experimentation, but you should hold off on that until you're familiar with the basics.

As for getting an environment together, you can screw around with MinGW or Cygwin to get it working on Windows, or install just about any Linux distro.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Good place to start learning C?

Post by rainwarrior »

mikejmoffitt wrote:As for getting an environment together, you can screw around with MinGW or Cygwin to get it working on Windows, or install just about any Linux distro.
And environment for what? What does Linux have to do with this thread?

Like, sure Linux usually comes with a C compiler, but there are like 100 different flavours of C for Windows that don't involve emulating Linux. (I've got nothing against MinGW btw; it's a decent compiler. Just kinda confused by the idea that installing Linux or Cygwin is a better idea than just installing a C compiler?)
Post Reply