C
ccwork
Hi all,
I found some people writing code as:
/****************** sample code ********************/
int ans;
...
printf("%c\n", " yn"[ans]);
/***************** sample code end *****************/
The value of variable "ans" will be an index to print ' ', 'y' or
'n'. Is this a syntax " yn"[ans] in standard C?
I found some people writing code as:
/****************** sample code ********************/
int ans;
...
printf("%c\n", " yn"[ans]);
/***************** sample code end *****************/
The value of variable "ans" will be an index to print ' ', 'y' or
'n'. Is this a syntax " yn"[ans] in standard C?