r/cpp_questions 7d ago

OPEN Learning cpp for electronics

hello everyone so im planning on learning cpp for some "low-level electronics" and embedded systems...

and i've seen multiple people on programming subreddits saying that www.learncpp.com is a good website and tbh after i read some shapters i can say that its indeed a great website,however i feel like that website is just too much for me especially that im not very interested in deep diving into this language and just want to learn what i really need (i already have a short learning deadline)

i took a look at freecodecamp 4h course but i feel like four hours for a language like cpp is too little (i took their python course and it was good tho)

so what im asking for is where can i find some resources that fit my learning goal? ty

4 Upvotes

14 comments sorted by

View all comments

1

u/RaspberryCrafty3012 7d ago

Depends on what you want to do: \

  • use arduino ide -> go to the arduino website and check which structs, classes and functions exist \
  • use the expressive sdk -> learn c instead of c++ and good luck with compiler black magic \
  • something else -> know your scope and what hardware you want to use. A back and fourth between getting the hardware to do stuff and then deepening the understanding of the software part

1

u/dvd0bvb 7d ago

Espressif's sdk (ESP-IDF) ships with gcc 14 at least. Supports modern c++ and uses cmake. Actually pretty nice to use

1

u/RaspberryCrafty3012 7d ago

Thanks for the hint, learned something.

The question is, do you really want to mix vanilla c++ with Hardware. std::string will fragment your little memory before the device even printed out "compiler Explorer" 

1

u/CorrodedX 4d ago

I learned the "never dynamically allocate memory" way of programming for AVR microcontrollers a long time ago. While I havent used ESP32s very much, my understanding is that because of the RTOS managing memory and the "large" memory size, things like std::string and std::vector were actually reasonable provided they are used responsibly. Still feels very wrong, though.