Hi guys, as you know we can get a value from array by giving an index:
int x[10];
int i;
for(i=0; i<10; i++)
x[i]=i;
print(x[1]);
// output is: 1
but how can I change this code to this:
int x[10];
int i;
x['a']=0;
x['b']=1;
x['c']=2;
.
.
.
x['z']=23;
print(x['c']);
//output is: 2
as you see the code above I can give a char to the array as an index and print its value....
Can I?
thanx