What does a secure code actually mean? Is it that you cannot make that code do something else, it wasn't supposed to do?
Many of my peers say to migrate to c++ or java as they are more secure because of oops, but when I ask why, they just say, "it's just.......it is".
An example would be so much appreciated. And I am fairly noob in C language, super-noob in c++. (just in case you wonder what complexity of answer would make me understand.)
Below are the parameter which makes any code Secure :
1. Code should do only what was intended.
    Eg: "select * from tablename where id='" + txtUserInputId + "'"
    In above query it is vulnerable to SQL injection.
2. Code must validate all the user inputs.
3. Authorization should be implemented properly other than Authentication.
4. User input data should be sanitized before processing.
5. Session should be managed properly. It also affect the security of code how sessions are managed in .Net or Java or any programming language.
6. Memory must be managed property. One process should not be able to access memory of other process.
7. Database constraints must be validated before any database operation.
8. Configurations must be protected from outside world. For eg: .Net framework does not allow users to see Web.config file. Web.config file may contain sensitive information like DB credentials.
Note: You can say that C#.Net is secure when it comes to query execution. Because it provides CommandParameter which automatically handles user input data for you.
How would you explain a layman person or a beginner in programming, the bold point of object oriented approach - the SECURITY?