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
https://en.wikipedia.org/wiki/The_C_Programming_LanguageIf you add the term PDF to the book title in a seach engine, you should have no trouble finding a copy of it.
I learned from this book a very long time ago:
http://www.free-engineering-books.com/2015/01/the-waite-groups-c-programming-using.htmlI 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.
Better yet, modify someone else's program. Change something.
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.
Memblers wrote:
https://en.wikipedia.org/wiki/The_C_Programming_LanguageIf 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.
Quote:
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.
C is nothing without a compiler.
Why is it that the compiler seems to be the ugliest part of any programming language?
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.
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.
Quote:
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.
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
Bregalad wrote:
Quote:
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.
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.
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?)
By "environment", I assume mikejmoffitt is referring to a toolchain for turning .c files into a .exe file, optionally with an IDE for editing .c files. And no, using MinGW doesn't amount to "emulating Linux". MinGW is not emulated; it's a port of GCC to Win32. Or perhaps by "emulating Linux" you really meant "reimplementing part of UNIX", in which case you're probably referring to a couple of alternatives without any GNU or BSD heritage: Visual C++ Express and Clang.
tepples wrote:
By "environment", I assume mikejmoffitt is referring to a toolchain for turning .c files into a .exe file, optionally with an IDE for editing .c files. And no, using MinGW doesn't amount to "emulating Linux". MinGW is not emulated; it's a port of GCC to Win32. Or perhaps by "emulating Linux" you really meant "reimplementing part of UNIX", in which case you're probably referring to a couple of alternatives without any GNU or BSD heritage: Visual C++ Express and Clang.
By "emulating linux" I meant Cygwin, specifically. I didn't find MinGW a strange suggestion, just everything that followed.
(i.e. if you're goal is to compile C programs and you're starting from Windows, installing Cygwin or Linux is a rather circuitous route to that goal.)
If you're going the MinGW route, I'd also recommend installing MSYS so you get Coreutils, Bash, and Make, which will help you build other people's programs without needing to go full Cygwin.
rainwarrior wrote:
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?)
The book expects you to have a C compiler set up to run from the commandline. I was trying to give a suggestion that wouldn't involve steps like "There's this big IDE, and there are a lot of buttons, so just go ahead and
ignore them and hit this one instead".
Both the Visual C++ compiler (cl.exe) and MinGW (gcc.exe) can be used from the Command Prompt. But if your book is written specifically for GCC, such as if it was written before Microsoft started offering Visual C++ Express half a decade ago, that means MinGW.
Maybe just as important as learning the C language, one should adopt a style for how you space out source code and name variables, etc. Figure out what works for you and be consistent.
Search google:
http://www.google.com/search?q=C+progra ... tyle+guide
tepples wrote:
Both the Visual C++ compiler (cl.exe) and MinGW (gcc.exe) can be used from the Command Prompt. But if your book is written specifically for GCC, such as if it was written before Microsoft started offering Visual C++ Express half a decade ago, that means MinGW.
And that's why I recommended MinGW in my post...
Make sure to go with MinGW-w64 though, the original MinGW is awfully outdated.
(also to make it clear, in case the name comes out as confusing: MinGW-w64 can do both 32-bit and 64-bit programs, in case you need to still support old Windows versions)
I need a compiler which is compatible with Vista x64 if that is clearer, since I don't use XP anymore.
Anyway, how to save pages offline? I saw a few links to stuff in here for C tutorials and would like to save them for reference as .html files without having to navigate everything, since I'll probably be on the first stage by tomorrow.
More than likely the first thing I'm coding is a few tools and an installer package for it for Vista x64.
Best book I know of, present-day, for learning C:
C Programming: A Modern Approach, 2nd Edition. Yes it's expensive, but you get exactly what you pay for in this case. I also like the K&R book, but for "newbies" it's a bit rough.