Opinions/Stories Best way to learn C - C++

mmkmmk3

n00b
Joined
Jul 20, 2012
Messages
41
I need to learn C, at least, but would love to learn C++. For microprocessors.

Who do you recommend to watch or read from. I've heard of one really good coder some time ago but alas, I have long since forgotten.
What I'd like to know is how you learned C/C#/C++ or what helped you learn (out of classes).
How long did it take you. Did you take hours a day or just periods of 20 minute learning sessions throughout the day. Did you do it on your own or have help or anything else. I just want to know how you did it. How long it took you. How well you think you know the code. Ect, ect. Anything that could help me is appreciated. This is mainly all opinion. I would like to know the name of that fellow again, anyone in particular come to you mind?
 
"For microprocessors"? All CPUs are microprocessors. Are you talking about embedded systems programming or something?

Anyway, I started C with a solid knowledge of Java and a little bit of assembly. All it really took was a few hours of staring at someone's code, plus an online tutorial or two on pointer manipulation, before I had most of it figured out. With a good enough grounding, you can probably get just about everything you need by skimming through a language reference. It's a pretty simple language.

That's just to get your head around the syntax, though; you're still a fair way from being proficient. Nothing much I can suggest for that except practice. And you'll probably still find some pretty baffling stuff in other people's code, between the little idioms (like while(*s++=*t++); to copy a string) and the layers upon layers of preprocessor macros.
 
"For microprocessors"? All CPUs are microprocessors. Are you talking about embedded systems programming or something?

Anyway, I started C with a solid knowledge of Java and a little bit of assembly. All it really took was a few hours of staring at someone's code, plus an online tutorial or two on pointer manipulation, before I had most of it figured out. With a good enough grounding, you can probably get just about everything you need by skimming through a language reference. It's a pretty simple language.

That's just to get your head around the syntax, though; you're still a fair way from being proficient. Nothing much I can suggest for that except practice. And you'll probably still find some pretty baffling stuff in other people's code, between the little idioms (like while(*s++=*t++); to copy a string) and the layers upon layers of preprocessor macros.
Microprocessors is a class I'll be taking next fall semester. It focuses more on atmel processors, the small ones. 32bit max, if even that.
I've had some experience in java and C# but I always got stuck when I had to call something I believe. It's been much too long for me to remember what it was I was doing is actually called.

Would this be someone from the C world, someone from the C++ world or someone from some other world?
I believe he is from the C & up world, going across multiple languages. I only remember him from some other forums, said that his books were great for starting out and even for later on.
 
You can go through the K&R book for learning how to program in C. The coding style is outdated, but it will build a solid foundation on system calls. It's a very short book. If you're dedicated and just starting out to program, you should be able to go through it in about 4-6 weeks.

The book is also known as the C Programming Language.

Here's a link: http://www.cs.ucsb.edu/~buoni/cs16/The_C_Programming_Language.pdf

There are a fair amount of Windows-isms that the book doesn't cover, as it's meant for UNIX. Still, it's a classic in the programming community.
 
Microprocessors is a class I'll be taking next fall semester. It focuses more on atmel processors, the small ones. 32bit max, if even that.
Sounds like you're talking about microcontrollers.

In that case, I'd stay well away from C++...
 
Your post could use some elaboration. Explain why he shouldn't use C++ so others can have an opportunity to provide counter-arguments.
 
If you're working with 512 bytes of RAM and a 4MHz CPU, you probably don't want to be writing code without a good idea of what it's actually doing at the hardware level. High-level language features (i.e. relatively complicated logic hidden behind simple syntactic constructs) are only going to get you into trouble while you're still trying to grasp the basics.

I'm not saying C++ doesn't have its place, just that it's far too big and too complicated a language to be a sensible starting point for this kind of thing.

Also, I suspect OP might be falling into the same trap I did - given that C is (more or less) a subset of C++, assuming that learning C++ would teach me C. It might give you the syntax, but the paradigms could hardly be more different. If C is what he needs to know, then C is what he should be studying.
 
Also, I suspect OP might be falling into the same trap I did - given that C is (more or less) a subset of C++, assuming that learning C++ would teach me C. It might give you the syntax, but the paradigms could hardly be more different. If C is what he needs to know, then C is what he should be studying.

Or better yet, he should make an effort to learn both.
 
Also, I suspect OP might be falling into the same trap I did - given that C is (more or less) a subset of C++, assuming that learning C++ would teach me C. It might give you the syntax, but the paradigms could hardly be more different. If C is what he needs to know, then C is what he should be studying.
Well I was about to ;) thanks. Yea, microcontrollers though. I should of made that obvious.

Or better yet, he should make an effort to learn both.
Referring back to Janitor's comment on microcontrollers, I assume he made the mistake that I was about to. I will eventually however, thanks!

Anyone care to comment on C# & its relativity to C?
 
Back
Top