Both structure and class are used to define custom data types.Classes is a reference type while structs is a value type. Classes are used to represent complex objects with multiple properties and method whereas struct is used to represent basic data types like integer, string etc. Struct are lighweight than classes and more suitable for functions that require high performance and low memory usage. Classes are less efficient than struct but can support inheritance and polymorphism that allows for more flexible and modular code.

E.g.

C#
struct Person
{

public string Name;

public int Age;

}
C#
Class PersonClass
{
public string Name;

public int Age;
}