Difference between array and ordinary variable in C

• The difference between the definition of array and ordinary variable is the, array is always declared, initialized, and accessed using subscript whereas ordinary variable do not have any subscript.
• The syntax for ordinary variable definition is
data_type v1, v2, ….;
• And the syntax for array variable is
data_type v1[N1],v2[N2],…;
where v1,v2 are name of variable and N1, N2 are the integer constants indicating the maximum size of array.

No comments:

Post a Comment