What is the Difference between "C structure" and "C++
structure"?

Answer Posted / satsen singh

C Structure :-
1. Only variables of different data types can be declared, functions are not allowed
2. Direct access to data members is possible
3. ‘struct’ data type is not treated as built in type – use of ‘struct’ necessary to declare objects
4. Member variables cannot be initialized inside a structure

C++ Structure :-
1. In C++ structure declaration functions can also be declared
2. The members declared in a C++ structure is public by default
3. While declaring an object the keyword ‘struct’ is omitted in C++

Is This Answer Correct ?    26 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is microsoft c++ redistributable?

610


Describe the advantage of an external iterator.

616


Is python better than c++?

584


How can we access protected and private members of a class?

589


What is the use of setprecision in c++?

544






How would you use qsort() function to sort an array of structures?

721


Is c++ fully object oriented?

553


When you overload member functions, in what ways must they differ?

590


What is the difference between a "copy constructor" and an "assignment operator" in C++?

620


What is a far pointer? where we use it?

613


Explain pass by value and pass by reference.

595


What is buffer and example?

525


What do you mean by late binding?

617


What is namespace & why it is used in c++?

608


Can non graphic characters be used and processed in C++?

704