W
W
WorldEn2017-02-01 17:35:56
C++ / C#
WorldEn, 2017-02-01 17:35:56

Continue training?

Good day!
I 'm currently taking an introductory course in C++ . There's theory and lots of problems. But the fact is that I want to program microcontrollers, and for this, as I already understood, the best option is C. The question is: this C++ course doesn't cover OOP and ends with dictionaries. After completing this course, at least some base on C ++ will remain in my head, but will there be basic knowledge of C? Or does C need to be studied separately?
PS: I'm sorry if the question is a bit dumb. It's just that Stephen Prata, for example, says that C differs from C ++ precisely in that C ++ has OOP and it is more extended than C. And on the forums everywhere they yell that these are generally two different languages ​​\u200b\u200band they only have a common syntax. And since I am ignorant in this matter, it is easy for me to get confused.

Answer the question

In order to leave comments, you need to log in

9 answer(s)
L
longclaps, 2017-02-01
@WorldEn

The syntax is general in that neatly written C code will compile on all popular C/C++ compilers.
This course is much better than nothing, and it won't hurt you to gain some C++ knowledge.

V
Vladimir Dubrovin, 2017-02-01
@z3apa3a

The difference is not in programming languages, the difference is in approaches. C in most real-world applications requires a complete understanding of what each line of code does and how exactly it works, while C++, especially in recent versions, allows for cookbook programming. This is dictated not so much by the language as by the tasks for which it is used, and yours in particular.
Therefore, yes, despite the fact that you practically already know the C syntax, if you know C ++, you still have to relearn. At the same time, pay attention not so much to the syntax of the language as try to understand what exactly is happening and how it is implemented. For the same reason, C textbooks are written quite differently and are worth reading anyway.

B
breakoffbrain, 2017-02-01
@breakoffbrain

I think it's worth starting with C (great book by D. Ritchie and Kernighan). C is easier, and even more so if you want to program for microcontrollers, then you don’t need C ++ capabilities

M
Maxim Timofeev, 2017-02-01
@webinar

Do you really think that there can be 2 answers to the question: "Who is smarter than Stephen Prat or the boy from the forum"?

A
abcd0x00, 2017-02-03
@abcd0x00

After completing this course, at least some base on C ++ will remain in my head, but will there be basic knowledge of C? Or does C need to be studied separately?

They have different styles when writing programs. C++ strives for one thing, and hence its own style. C strives for something else, from there and its own style. That is, you will not only run into differences in syntax (which are), but also write in C in the wrong style, doing all sorts of redundant and unnecessary things. C programs are much shorter than similar (equivalent) C++ programs.
For an example to you:
In C++, if there is a type conversion, it is done explicitly, and with the choice of the correct type conversion operation (casting).
In C, the same thing is written simply without any operations, because there is an implicit type casting (according to the standard), which you know about, and therefore you don’t need to write anything.
That is, minus one trouble, which in C ++ eats the source text, and in C it is not used at all, leaving the source clean and concise.

A
Alexander Skusnov, 2017-02-03
@AlexSku

What is the difference between a microcontroller and a microprocessor?
1) additional network protocols. -> study
2) automation algorithms. If you have time, learn PLC languages ​​(Codesys), and you can practice with algorithms in Matlab (Stateflow is useful for automation).

E
evgeniy_lm, 2017-02-01
@evgeniy_lm

C from C++ are two different languages ​​with a common syntax
. These languages ​​were created by completely different people
. C++ was originally called "C with classes"

D
Dmitry Smolyakov, 2017-02-01
@spudro

If you want more, then another course on the steppe .

N
Neznayka xD, 2017-02-01
@Neznayka1979

Hmm... who advised you to start with C++ ?
Before you start learning C++ , you need to master C.
You can watch video tutorials on C here :
https://www.youtube.com/channel/UC3ewRHk6A2fhsUt6v...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question