What normal C constructs work differently in C++?

Answers were Sorted based on User's Feedback



What normal C constructs work differently in C++?..

Answer / guest

- Assigning int's to enum's.
- Assigning void pointers to other types of pointers.
- Function declaration foo() without parameters.
- Character constants are of type char in C++. They are of
type int in C.
- ALL functions MUST be prototyped in C++, which is not
required in C.
- In C++:
struct A { /* ... */ };
is equivalent to:
typedef struct A { /* ... */ } A;
in C.

Is This Answer Correct ?    2 Yes 0 No

What normal C constructs work differently in C++?..

Answer / achal ubbott

I just add 2 more points. C++ is a different language. Its
syntax matches to C accidentally.

1. C++ follows a name mangling algorithm for names of
functions. C does not.

2. C++ structures may have functions defined in them. Not
in C.

3. C++ follows more strict type checking.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

WHAT IS THE ACTUAL DEFINATION OF OBJECT AND THE CLASS IN ONE SINGLE LINE WHICH THE INTERVIEWER WANT TO LISTEN.

11 Answers  


what i oops concept, how many languages supports oops concept?

3 Answers   Value Labs,


what is the main difference between sizeof() operator in c and c++

3 Answers  


What is an advantage of polymorphism?

0 Answers  


What are constructors in oop?

0 Answers  






wht is ditch

0 Answers  


what is the drawback of classical methods in oops?

0 Answers  


What is balance factor?

0 Answers  


how to write a java program for an output ****0 ***01 **012 *0123 01234

1 Answers  


What is the oops and benefits of oops programming?

0 Answers  


what is abstract class ? when is used in real time ? give a exp

5 Answers  


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

0 Answers  


Categories