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 are examples of structures?

0 Answers  


How reliable are floating-point comparisons?

0 Answers  


Is swift based on c?

0 Answers  


What is the purpose of the preprocessor directive error?

0 Answers  


A B C D E F G F E D C B A A B C D E F F E D C B A A B C D E E D C B A A B C D D C B A A B C C B A A B B A A A

2 Answers  






What do you mean by dynamic memory allocation in c?

0 Answers  


Can you please explain the difference between malloc() and calloc() function?

0 Answers  


What is the use of header?

0 Answers  


write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.

0 Answers   Subex,


Write a c program to enter a string of paragraph and replacing a particular word which is repeated in the paragraph by another word?

2 Answers   ME, Synfusion, Wipro,


A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?

0 Answers  


What is the benefit of using #define to declare a constant?

0 Answers  


Categories