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

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

Answers were Sorted based on User's Feedback



Is there something we can do in C but not in C++? Declare variable names that are keywords in C++..

Answer / 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

Is there something we can do in C but not in C++? Declare variable names that are keywords in C++..

Answer / lucky

#include<stdio.h>
#include<conio.h>
void main()
{
int class=0;
printf("5d",class);
getch();
}

Is This Answer Correct ?    6 Yes 3 No

Post New Answer

More C Interview Questions

What is the use of putchar function?

0 Answers  


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

0 Answers  


What is a loop?

0 Answers  


how to find the sizof of any datatype using bit manipulations

3 Answers  


How can I split up a string into whitespace-separated fields?

0 Answers  






Display names and numbers of employees who have 5 years or more experience and salary less than Rs.15000 using array of structures (name, number, experience and salary)

1 Answers  


Can a function argument have default value?

0 Answers   Genpact,


wat is the difference between array and pointer?

4 Answers   Wipro,


Average of a couple 10 years ago was 25. The average remains same after having a child and twins after 3 years. What is the present age of the first child

10 Answers   IBM, Infosys,


What are unions in c?

0 Answers  


What is function prototype in c with example?

0 Answers  


say the following declaration is correct nr not. int b=a,n=0;

4 Answers   Wipro,


Categories