0

What is structure?program for structure.

3rd Mar 2017, 6:17 AM
Satyam Jaiswal
Satyam Jaiswal - avatar
3 Answers
+ 6
Edited: In C, Structure is collection of elements with different data types. Its similar like arrays but it can have different datatypes. Syntax: struct strict_name { int var; char var1; float var3; }struct_variable;
3rd Mar 2017, 6:26 AM
Mr.Robot
Mr.Robot - avatar
+ 2
@Mr.Robot that is true in C not in C++ (I know it is strange but they changed it to adapt it to OOP)
3rd Mar 2017, 6:27 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 1
Structure is a class where the default privacy is "public" (you use it generally when you want a class with everything public)
3rd Mar 2017, 6:26 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar