Monday, August 18, 2008

Some queries

Hi all

Please find the questions below

1. Which language among C/C++ is best in terms of performance?
2. If C is best, which factor in C++ makes it unfit in performance?
3. And if C program is compiled by C++ compiler, will the performance
be reduced?

Answers
1. C is better performance wise when compared to C++. We would chose C+
+ programming for portability and highly restricted access to critical
resource from the applications (Encapsulation)
2. The factor that makes C++ unfit in performance is that Run Time
overhead. Means the features like Run Time polymorphism (not supported
in C) in C++ would result in slower execution
3. No idea

Please let me know if any thing wrong mentioned in this. And please
let me know the answer for 3rd question.