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

Out of fgets() and gets() which function is safe to use and why?

958


What new()is different from malloc()?

838


give me an example for testing a program showing the test path .show how the test is important and complex.

2686


What is an orthogonal base class in c++?

889


Can a program run without main in c++?

853


What is static class data?

798


Explain all the C++ concepts using examples.

946


How a modifier is similar to mutator?

898


What do you mean by ‘void’ return type?

852


What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00

837


Which is best ide for c++?

772


Write about the local class and mention its use?

838


What is the difference between ++ count and count ++?

851


What are the various access specifiers in c++?

810


What are proxy objects in c++?

908