What normal C constructs work differently in C++?
Answers were Sorted based on User's Feedback
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 |
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 |
What is the use of unnamed namespaces in OOPS? The only advantage I know is that they dont need the scope resolution operator while accessing them. I want to know some other advantages of unnamed namespaces...
what is the new version of oops
What is difference between #define and const?
You have one base class virtual function how will call that function from derived class?
how do you handle yourself when you feel the wald is aganist you
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
We have a scale and 7 balls. 1 ball is heavier than all the rest. How to determine the heaviest ball with only 3 possible weighing attempts?
Templates mean
what is a ststic variable and stiticfunction briefly explain with exmple and in which case we use
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
Contrast OOP and SOA. What are tenets of each?
1 Answers Siebel Systems, Wipro,
What is difference between pop and oop?