What is the difference between Class and Structure?

Answer Posted / rohit patil

Syntax of class
class class_name
{
variable_declaration
function_declaration
};

syntax of structure
struct struc_name
{
variable declaration
};

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you clear a set in c++?

605


What are pointers used for c++?

570


What is size_type?

545


Is c++ used anymore?

585


What is a literal in c++?

566






Explain the difference between static and dynamic binding of functions?

547


Is ca high or low level language?

582


Explain the isa and hasa class relationships. How would you implement each?

609


Explain "const" reference arguments in function?

610


How to declare a function pointer?

575


Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.

1717


What is else if syntax?

675


What is encapsulation in C++? Give an example.

584


What is singleton class in c++?

592


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

620