Is C++ a turing complete language?
Obviously that would be the case, but how is it proven practically?
Is there a minimally reproducible example that shows that this is the case?
Is C++ a turing complete language?
Obviously that would be the case, but how is it proven practically?
Is there a minimally reproducible example that shows that this is the case?
Yes it is, from wikipedia Turing completeness
To show that something is Turing-complete, it is enough to show that it can be used to simulate some Turing-complete system. For example, an imperative language is Turing-complete if it has conditional branching (e.g., "if" and "goto" statements, or a "branch if zero" instruction; see one-instruction set computer) and the ability to change an arbitrary amount of memory (e.g., the ability to maintain an arbitrary number of data items).
Then imperative languages lists C++ as such.
I'm not an expert of computational theory but as empirical law a language is declared Turing-complete if it supports conditional branching, i.e. it must support if statements and go-to instruction. So the majority of languages out there is Turning-complete.
mindcell blown – bolov Aug 02 '20 at 14:35