I have beenI'm trying to differentiate c and c++(or oop languages) but I don't understand where the difference isbetween procedural languages like C and object-oriented languages like C++.
Note I have I've never used c++C++, but I askedI've been discussing with my friends and some of themon how to differentiate c and c++the two.
They say c++I've been told C++ has oopobject-oriented concepts and also theas well as public, and private modes for definition of variables and which c: things C does not have though. Seriously I have done vb.net programming for a while 2 to 3 months, II've never faced a situationhad to use class concepts and modes of definition like public and privatethese for while developing programs in Visual Basic. So I thoughtNET: what could beare the use forbenefits of these?
My friend explained me a program sayingI've also been told that if a variable is public, it can be accessed anywhere I said why, but it's not declare it asclear how that's different from a global variable like in c? He dida language like C. It's also not get back to my question and he said ifclear how a variable is private it cannot be accessed by some other functions I said why not define it asvariable differs from a local variable, even these he was unable to answer.
No matter where I read private variables cannot be accessed whereas public variables can be then why not make public as global and private as local whats the difference? whats the real use of public and private ? please don't say it can be used by everyone, I suppose why not we use some conditions and make the calls?
I haveAnother thing I've heard people sayingis that, for security reasons, a friend said if a function needneeds to be accessed it should be inherited first.
He explained saying The use-case is that only adminan administrator should be able toonly have someas much rights and not all so that functions are made privateas they need and inherited only by the admin to use
Then I said why not we use if conditioneverything, but it seems a conditional would work as well:
if ( login == "admin") {
// invoke the function
}
he still didWhy is this not answer these question. Please clear me with these things, I have done vb.net and vba and little c++ without using oop concepts because I never found their real use while I was writing the code, I'mideal?
Given that there seems to be a little afraid amprocedural way to do everything object-oriented, why should I too back in oop conceptscare about object-oriented programming?