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

Magic square

0 Answers  


what is the definition of storage classes?

3 Answers   Wipro,


How can I remove the trailing spaces from a string?

0 Answers   Aspire,


User define function contain thier own address or not.

2 Answers  


What are the 4 types of programming language?

0 Answers  






What is the difference between a function and a method in c?

0 Answers  


Can one function call another?

0 Answers  


What is structure data type in c?

0 Answers  


How can variables be characterized?

0 Answers  


void main() { int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} }; int (*p)[2]; int i,j,*pint; for(i=0;i<=3;i++) { p=&s[i]; pint=p; printf("\n"); for(j=0;j<=1;j++) printf("%d",*(pint+j)); } } while running this program it shows a warning-suspicious pointer conversion ie pint=p; my que is why should we assign the value of p to pint again.why cant we use it directly as *(p+j)..but if i use like tat the o/p is garbage value..

1 Answers  


Simplify the program segment if X = B then C &#8592; true else C &#8592; false

0 Answers  


what is the difference between procedure oriented and object oriented progaming language

1 Answers  


Categories