static int i=0;
cout<<"Enter the name:";
Can any one tell me that whats wrong with this code..actually i want to store 20 names in it..
For one thing, your array is called
a, but you're doing a cin.get to to a variable called
name which is not defined.