On the right track?

I have just started to learn C++. Ultimately I am interested in Microcontroller programming and would appreciate some advice as to whether I am barking up the wrong tree or not.

From what I understand I will need a compiler that is geared up for generating machine code for the particular family of MCU's I will be working with (not sure which yet and I'm open to suggestions.).

I have seen compilers for C but not (many) for C++ and need some verification as to the reasons for this. If I only use the C Standard Library (not the extra functionality offered by C++ and OOP) would I then be creating valid C code? For instance, would I have to use <stdio.h> instead of <cstdio> and would I have to prevent myself from using OOP and adhere to structured techniques?

I was hoping that by learning C++ I would by default learn C. Is this the case? I want to be able to take the advantage of the benefits and knowledge of C++ over C but don't want to have to re-learn to achieve my ultimate goal of Microntroller programming.

If there may be a better place to ask these questions then please say.

Thanks.


C code is valid C++ code, but vice versa is not always true. If you want to be able to write C code for MCUs, then learn C ;).
Topic archived. No new replies allowed.