- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
When to use C over C++, and C++ over C?
45 Lectures 4.5 hours
66 Lectures 5.5 hours
If you would like an application that works directly with computer hardware or deals with the desktop app development, C++ is an good option. C++ programs include server-side applications, networking, gaming, and even device drivers for your PC. However, if you need to code truly tiny systems, using C will result in less overhead than C++.
C++ is well-rounded in terms of platforms and target applications, so if your project is focused on extremely low-level processing, then you may want to use C++. C++ is often used for large-scale, multi-man, complex projects where separate people need to work on modularised components. You can build and maintain modularised code in C, of course, but the inherent OOP nature of C++ leads to superior modularisation, testability, and code-reuse.
So TLDR; you should only use C over C++ when −
- You need a portable assembler. Although C++ is also portable, on very resource constrained systems, using it can be a nightmare.
- Your platform doesn't provide C++
- You need to interact with other languages that can only interact with C
- When to use LinkedList over ArrayList in Java
- How to iterate over a C# dictionary?
- How to iterate over a C# list?
- How to iterate over a C# tuple?
- Benefits of C over other languages
- Enumerate over an enum in C++
- When to use inline function and when not to use it in C/C++?
- How to use Python modules over Paramiko (SSH)?
- Advantages of vector over array in C++
- Sum over Subsets - Dynamic Programming in C++
- C# program to Loop over a two dimensional array
- When to use extern in C/C++
- Advantages of vector over the array in C++?
- Packet over SONET