What is the Difference between "C structure" and "C++
structure"?
Answers were Sorted based on User's Feedback
Answer / ranjeet garodia
In C++, structure behaves like class like can add function,
and can use properties on class as inheritance, virtual,
etc.
while in C, structure we can have only data member but not
functions.
Is This Answer Correct ? | 57 Yes | 8 No |
Answer / balaji
1)In "C++" Structure we can specify the data and functions as public,private or protected but in "C" Structure we can't.
2)In "C" Structure Variable initialization must contains the keyword struct but in C++ not required.
Is This Answer Correct ? | 34 Yes | 2 No |
Answer / sanket
In C++ structure you can add functions whereas in C
structure you cannot!
Is This Answer Correct ? | 39 Yes | 10 No |
Answer / 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 |
Answer / jayesh pawar
1)In "C++" Structure we can specify the data and functions as public,private or protected but in "C" Structure we can't.
2)In "C" Structure Variable initialization must contains the keyword struct but in C++ not required.
Is This Answer Correct ? | 9 Yes | 3 No |
Answer / prathap
in c structure we can't difine anddclare functions.
but in c++ it is possible but there is no security for that
purpose we use classes instead of functions.
Is This Answer Correct ? | 5 Yes | 5 No |
Answer / brainless
According to c++ standard, structure is a kind of class.
However, all members are default to "public".
Is This Answer Correct ? | 5 Yes | 9 No |
Answer / b.soundarya kumari
THE C AND C++ IS DIFFERENT IN C IS EXIGUITY IN SOME MACHINCES
BUT C++ DID NOT EXIGUITY INTHAT MACHINCES.IT EXIGUITY IN
OTHER MACHINE.
Is This Answer Correct ? | 0 Yes | 5 No |
Answer / sai
c is a structured programming language where as c++ object
oriented programming language
Is This Answer Correct ? | 6 Yes | 12 No |
Answer / shweta iyer
In C, the header file used for input/output is #include<stdio.h>
whereas in C++, the header file used for input/output is
#include<iostream.h>
Is This Answer Correct ? | 4 Yes | 10 No |
What is flush () in c++?
What's c++ used for?
When do we use copy constructors?
What are advantages of C++ when comparing with C?
18 Answers HP, iGate, TCS,
How can you say that a template is better than a base class?
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.
Explain Memory Allocation in C/C++ ?
What is guard code in c++?
Differentiate between a copy constructor and an overloaded assignment operator.
Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?
difference between c and c++?
38 Answers Cognizant, IBM, Infosys, Oracle, Sarva Shiksha Abhiyan, Wipro,
What is dynamic and static typing?