Explore the differences between C and C++, including language methodology, and some other features that are important if you're applying for a C++ position.
- [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 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 back end 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 are 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 visa 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 C, 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.
Anytime 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 include 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 programing 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++.
- Getting ready for interviews
- Types of questions you can expect
- Comparing C and C++
- Strings and arrays
- Linked lists
- Stacks and queues