what isthe difference between c structure and c++ class

Answer Posted / harshad khedekar

c does not allow struct data type to be treated like built-in datatype also it does not supports data hiding concept.in c++ instead of struct we have class which overcomes all the above limitations.

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box

2304


What is property in oops?

814


What are the benefits of interface?

822


What is class and example?

833


What is difference between abstraction and encapsulation?

831


What is protected in oop?

827


write a program that takes input in digits and display the result in words from 1 to 1000

2208


Can we define a class within the interface?

814


write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).

1936


What is the difference between inheritance and polymorphism?

825


What is the main purpose of inheritance law?

965


What is the problem with multiple inheritance?

859


class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash

2010


What is polymorphism give a real life example?

785


What is the main feature of oop?

920