Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there something that I can do in C but I can't do in C++?

Tags:

c++

c

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...

like image 257
yusuf Avatar asked Feb 04 '09 19:02

yusuf


People also ask

Is there something that I can do in C and not in C++?

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.

Can you do anything in C++?

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.

Can you do C in C++?

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.


1 Answers

Declare a variable named 'class', as in:

int class = 0;
like image 67
Sjoerd Avatar answered Nov 09 '22 03:11

Sjoerd