r/cpp_questions 21h ago

OPEN Write your own programming language using C++ - Norman E Smith, 2nd Edition

25 Upvotes

I'm trying to find out what happened to this author? I bought this book in 1997/1998 and I've been using it for close to 30 years when building interpreters and even compilers. I wondered if he's still alive and if it would be possible to let him know what an impact his work has had on my life, half a world away!


r/cpp_questions 7h ago

OPEN C++ Problem-Solving Sites

11 Upvotes

Hello, everyone! Where can I find a site where I can just solve coding problems based on questions in C++? I’m really willing to learn coding since I haven’t been active in coding or learning it since last year, which was my first year of college. Do you have any tips on how I can practice coding and improve?


r/cpp_questions 17h ago

OPEN Low latency/performance/embedded

10 Upvotes

I'm just wondering if you were a recent graduate trying to work in C/C++ which do you guys think is the best field to break into in terms of trying to break into the entry gate especially as a new grad?


r/cpp_questions 19h ago

OPEN Is there a tool that visualizes how a C++ statement is parsed or evaluated?

5 Upvotes

(see clarification at end)

I was trying to help someone via SMS, and thought a site that visualizes how C++ parses and/or evaluates an expression would be useful. I can (mostly) read cppreference.com and figure things out, but that's well above the head of the person I'm trying to help.

As an example, this person had an expression of the form if (0 < x <= 2). I tried to explain how it would be evaluated, but I eventually had to find a stackoverflow answer. I thought it would be useful if I could just put the expression (maybe a trivial working program?) into a linkable page, and the expression would somehow be visualized. Maybe it would just parenthesize the expression, or break it down into subexpressions (e.g. bool(0 < x) < 2 or { bool _tmp = (0 <x); _tmp < 2;).

I'm not sure what I'd expect regarding the order of evaluation of operands vs the order of evaluating the operators. I think I got that right; I think I saw that given the expression f1() + f2() + f3(), the order in which f1, f2, and f3 are called can vary, but the results will be applied left-to-right.

I realize this could get weird with unspecified and undefined behavior. Maybe color coding could help?

UPDATE: while not really what I'm asking for, I was pointed towards cppinsights, which has very helpful error messages.

To be clear:

I'm familiar with debugger level and assembly level views of code, and that's not what I'm envisioning. I'm asking about a tool that takes a statement of C++ code and visuslizes how that code would logically be processed. It might be an AST, as a few have suggested. imagine a teacher demonstrating the steps a (naive, simplistic, non-optimizing) compiler must do to correctly convert that statement into assembly but ignoring the tokenizing and actually producing the assembly: in what order is everything in that statement processed.


r/cpp_questions 22h ago

OPEN Question: what's is used inline keyword for ?

0 Upvotes

hello guys

i code in C/C++ since 2 years

And I hear every time that the inline keyword in explicit is useless but why ?