General Discussions

Operations on Structures

Following are the things to keep in mind while operating on structures:

Comparison
1. Two structure variables cannot be compared. Whether they are of same type of dissimilar, they can’t be.
2. Members of two structure variables of same type can be compared using relational operators.

Copying 2 structure variables
1. One structure variable can be assigned to another structure variable if and only if both of them have the same data type.
2. It can be done using the assignment operator (=).

Arithmetic operations on structures
1. Members of structures are similar to any other variables.
2. Any operation that can be performed on a variable, the same operation can be performed on structure members as well.


Read more about structures and c, from the free ebook: Structures and C

Advertisements

Let me Know What you Think!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s