Computer Programming
C Programming
C++ Programming

Structure in c?



User Avatar
Wiki User

A structure (from now on called struct), is a list of several ODT (old data types).

I can have a structure that keeps track of, let's say my user info:

struct User {

char Username[256];

int TimeOn;


Note the semicolon.

Now, you can access structs by declaring a variable of struct User.

struct User UserOne;

UserOne.Username = "Bob";

UserOne.TimeOne = 0;