From the course: Nail Your C++ Interview
Difference between C and C++ - C++ Tutorial
From the course: Nail Your C++ Interview
Difference between C and C++
- [Instructor] In any interview, you will encounter a face-to-face question and answer session. These portions of the interview are important to show that you have a depth of understanding and ability to relay that information that goes beyond the keyboard. As I go over some of the topics to review, focus on why they are important to know and understand because that will be what you'll most likely discuss in the interview. I'm sure you already know by now that C and C++ are closely related. So close that C++ is essentially C. Yes, C++ is a derivative of the C language. So you may get asked if you know C or at least know the difference between C and C++. This topic may come in a simple do you know a difference between the two type question or a more in-depth conversation like why is it important for a backend developer to understand the difference between C and C++? No two other languages are both similar and different like C and C++. So it's a popular interview topic in both C and C++ interviews. Knowing that C++ came from C can help your understanding of how things are structured. This can be very helpful if you're updating legacy code from C to C++. Some of the items in C++ are just carried over from C, so knowing both languages is helpful but not necessary to becoming a C++ developer. Let's look at the most obvious difference between the two languages. C++ is an object-oriented programming language and C is not. C++ is also a procedural language and so is C. This means everything you can do in C, you can do in C++ but not vice versa. Because C++ has the added features of object-oriented programming, it isn't limited to just the procedural constraints like C. Most modern languages are object-oriented. But understanding a procedural language can be important for maintaining or updating legacy code. Another key difference is the fact that C++ supports exception handling at the language level. This can be very helpful for debugging your code. But in x, there is no explicit exception handling. It can still be done but it has to be manually coded in an if/else type manner. Manually programming exceptions can be a time-consuming process, and if left to the user to write, the possibility of a mistake can be detrimental to the project. Any time you are working on any code these days, even if you are not directly dealing with people's data, you still face the issue of data safety in terms of cyber security. Both languages includes some ability to hide data. In C++, it's done by using classes and in C with static members, although in C++, the usability of a class is much better than with C's static members. C++ brings to the table a special way of tying procedural style with object-oriented programming. It was one of the first object-oriented programming languages written and is responsible for most software items we use today, things like Windows, Facebook and Google, to name a few, have some portion written in C++.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.