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 do you mean by binding of data and functions?

3 Answers  


what is the advantage in software? what is the difference between the software developer and Engineer

1 Answers  


How many human genes are polymorphic?

0 Answers  


which are the 4 members functions in c++ objects that can either be declared explicitly by programmer or implementation if nt available.

4 Answers  


what is oops

4 Answers   NIIT,






What is the difference between pass by value,pass by pointer,pass by reference in the catch block in the exception handling in c++

1 Answers   TCS,


what is multithreading in c++ , what is difference between multithreading and singlethreading.

4 Answers  


What is the difference between Home and $Home?

2 Answers   TCS,


What does the keyword "static" mean?

4 Answers   TCS,


Conversion from a basic type to a class type may be achieved using______________

5 Answers   HCL,


what is the application of oops?

8 Answers   IBM,


Why do we need polymorphism in c#?

0 Answers  


Categories