Is there something we can do in C but not in C++?

Declare variable names that are keywords in C++ but not C.

Answer Posted / ruth

Aside from a few minor differences, there's nothing C can
do that C++ can't. About the only things I can think of are:

int foo = Something();

int array[ foo ]; // C++ can't do this, but C can IIRC


Of course C++ provides alternatives to do the same thing:

vector<int> array(foo); // similar code in C++


C is more friendy for making external libraries. A DLL
compiled in C will likely work in any C/C++ program made in
any other C/C++ compiler. Whereas DLLs made with C++ often
only work in C++ programs made in the same C++ compiler

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between formatted&unformatted i/o functions?

632


Write a program to reverse a given number in c language?

633


What is the process of writing the null pointer?

617


why wipro wase

1844


how should functions be apportioned among source files?

638






Which header file is essential for using strcmp function?

956


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

684


What are register variables? What are the advantage of using register variables?

698


List a few unconditional control statement in c.

574


What is a buffer in c?

588


What is call by reference in functions?

587


Why flag is used in c?

667


What does %2f mean in c?

700


What is clrscr in c?

688


How do you view the path?

677