Right Click to Search

Tuesday, December 29, 2024

Array Declaration in C


Array Declaration in C
  • Array has to be declared before using it in C Program
  • Array is nothing but the collection of elements of similar data types
Array Declaration Requires -
  1. Data Type
  2. Valid Identifier
  3. Size of Array
Declaration tells to Compiler ?
  1. Type of the Array
  2. Name of the Array
  3. Number of Dimension
  4. Number of Elements in Each Dimension



Syntax :
data_type array_name  [size1][size2].....[sizen];
  1. data_type : Data Type of Each Element of the array
  2. Array_name: Valid variable name
  3. [size1][size2].....[sizen]: Dimensions of the Array
Examples : 1
// Array of 10 integer roll numbers  
int roll[10]   
Examples : 2
// Array of 80 characters 
char name[80]  

Tags / Keywords : | , ,

Stumble
Delicious
Technorati
Twitter
Facebook

0 Comments:

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email

 

Learn C Programming Copyright © 2010 LKart Theme is Designed by Lasantha, Free Blogger Templates