Is there something that I can do in C but I can't do in C++ ? I stumbled upon the question in a sample interview questions site...
There's no computation you can accomplish in one language but not the other. There are programs that will do one thing in C and something else in C++ (or fail to compile) according to the Standard, although rewriting these is usually trivial.
This versatility means that C++ can be used to write almost anything that runs on a computer, as long as the programmer knows what they are working towards and has a platform or device that the finished program can run on.
Accessing C Code from Within C++ SourceAll C++ compilers also support C linkage, for some compatible C compiler. When you need to access a function compiled with C linkage (for example, a function compiled by the C compiler, or a function written in assembler), declare the function to have C linkage.
Declare a variable named 'class', as in:
int class = 0;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With