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 stack unwinding?

690


Why pointer is used in c++?

710


What does return 0 do in c++?

690


Explain public, protected, private in c++?

658


What is the best c++ ide?

698






Is c++ platform dependent?

727


When do you call copy constructors?

763


Is c++ the best programming language?

643


What is the difference between passing by reference and passing a reference?

658


What is the difference between a definition and a declaration?

662


Write is a binary search tree? Write an algo and tell complexity?

690


What is the meaning of string in c++?

662


What is low level language in simple words?

643


Write a program to find the Factorial of a number

680


What is pointer to member?

680