• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

How To Learn C++

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
I’ve been proudly learning C++ on and off for almost four years now.

after successfully seg-faulting Node.js with a node api C++ program and getting hopelessly addicted to the language, I think I’ve earned some leeway to advise on how to learn it.

C++ is a beast – metaphorically AND literally.

It’s so large that 7 days into a head-first deep dive, I’m still discovering new things. but once you learn "enough" of it, you can do some ridiculously cool stuff… with a huge chance of "

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

" in the process.

Why Learn This Beast of a Language?


It’s the bloodline of AAA games, game engines, and critical runtimes like Node.js. Want to get closer to the kernel? Embedded systems? AI can’t…? vibe coders can’t…

That’s power.

After years of trial and error (and the occasional distracted rabbit hole), here’s the roadmap that finally worked for me:

1. Learn C Very Well (Yes, Really)

“C compiles in C++, not the other way around.”
"C and C++ aren’t the same!" – I know.

C is simpler (not easier). C compiles in C++ – not the other way around. since C++ descends from "30-year-old C," the fundamentals transfer.

4 C Concepts to Learn:

1. The Type System


uint32_t vs. int32_t? The mysterious size_t?

2. Contiguous Memory & Buffers


char* str = "Hello World";

Your string(str) is a pointer to ‘H’.

3. Composite Types


struct person {…};
typedef struct {…} person_;

The difference? both let you craft custom data structures.

4. System Calls


Files, network sockets, kernel events (epoll). learn these, and you’ll understand how computers actually work

2. Know Your Pointers


In C++ you get smart pointers to the rescue:


ElementPtr childPtr(inpt);
addToParent(…, std::move(childPtr)); // Ownership transferred

If you don’t understand raw pointers and ownership semantics, smart pointers will feel like black magic and you'll end up "shooting your leg off".

Beej’s

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

is an excellent resource to get started with C and pointers.

3. Header Files Are Contracts


Think of header files as promises: “Hey clang(put an IDE server here), trust me—I’ll give you the real function later.”

Here’s how a clean setup looks:

Header file:


// add.h
int add(int a, int b);

Cpp implementation:


// add.cpp
#include "add.h"
int add(int a, int b) {
return a + b;
}

usage:


// main.cpp
#include "add.h"

int main() {
int sum = add(1, 2);
return 0;
}

Compilation:


g++ main.cpp add.cpp -o sum

Do not include .cpp files inside other .cpp files.

Header files are how you break your project into clean, reusable parts.

4. Build Something You Care About ?


Tutorials are cool. But building something you actually want? That’s how you stay hooked.

Not sure what that is? Dig into that low-level itch you keep ignoring.

Purpose beats motivation, every time. you’ll debug linker errors at 3 AM for fun.

5. Make It Work → Then Make It Good


My mantra:


  1. Code it ugly


  2. Make it work


  3. Make it work well


  4. Refactor (when I’m smarter ?)

Inspired by:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



"Premature abstraction is the root of all evil."

I Promise: It’s worth it. I’m 14 days into building my own GUI library and I’m hooked.

Bonus: Windows users – install Visual Studio 2022 or embrace WSL2. Your sanity will thank you.

More Content
Free:


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



favicon
payhip.com


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу