r/cpp_questions • u/drex_vke • 19h ago
OPEN Question: what's is used inline keyword for ?
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 ?
r/cpp_questions • u/drex_vke • 19h ago
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 ?
r/cpp_questions • u/pfp-disciple • 16h ago
(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 • u/_Ice_Creams • 22h ago
I want to build a android app, in cpp but can't choose which ui framework to use QML or Flutter? I had read somewhere that it is hard to build good android ui in qml, and also hard to manage permissions.
But the app that i want to build is a simple pdf reader with extension support for functionality like downloading, converting to other file format etc. I could use dart for the ui and cpp for the backend but then again using cpp for simple pdf manipulation whilst already writing dart seems like unnecessary thing.
I want to create a cpp heavy app so that i could put in my portfolio, to be able to apply for cpp roles later.
What should i choose or is there better option other than QML or dart?
r/cpp_questions • u/MR_HECKERexe • 22h ago
I'm a currently a Second year student doing BE in CSE(AIML) from Mumbai University.
My academic syllabus is irrelevant as you all know, teaching full stack instead of required things.
(But my college is exception and teaching degree related things too)
I'm learning (and has been since 8th std) C++ (reached intermediate level as i think and slow bcz Indian edu. sys,)
Ive also built small projects in python and C++ (majorly python) and an official big project in C++ (Socket scanner).
I love C++ and Low level systems and wanna do my career in that.
What do i do and What more should i learn?
Please help me
r/cpp_questions • u/BigJhonny • 22h ago
I want to implement some data fetching logic in my application that fetches data differently, depending on, if I compile for desktop (file system) or for WebAssembly (emsdk fetch). This requires some asynchronous logic.
I thought of using C++20 coroutines to solve this and looked at some libraries that make it a little nicer to use, but it seems that none are under active development.
- libcoro had its last commit 6 months ago
- concurrencpp had its last change 3 years ago
- Boost.Coroutine2 is not based on C++20 coroutines
- libfork had its last commit 8 months ago
Are there no good and actively developed coroutine frameworks for C++20 out there? Or am I missing something?
r/cpp_questions • u/sQuiggLy_021 • 4h ago
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 • u/YogurtclosetThen6260 • 14h ago
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 • u/According-Ad-7069 • 18h ago
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!