Structures are a group of data elements, and we can access them using the structures. The data elements can be from any types.
Sample of a structure
struct StructName { int i; char c; } obj1, obj2;
So, a structure is declared with the "struct" keyword, then comes its name. Then, in the braces we declare the data elements. After the braces we write the names (object) we will use for using that structure, that objects are global. We end with a semicolon.
Instead of the global object, we can create other objects wherever we want.
Here is an example of creating the object
struct StructName obj;
And then, using its data elements
obj.i=5; obj.c='a';
We can create as many as we want objects from a structure.
- Read/Write Registry Keys
- Write To File In C++
- Adding Items to ListView Control
- Write To File in C#
- ASP at a glance
Enter your Name and Email below to subscribe and start 1 month free course now.








