This is the program to convert a number into different representations like octal,decimal,hexadecimal etc.

```
    #include<stdio.h>

    char *convert(unsigned int num, int base)
    {
    static char buff[33];
    char *ptr;
    ptr=&buff[sizeof(buff)-1];
    *ptr='\0';
    do
    {
    *--ptr="0123456789abcdef"[num%base];
    num/=base;
    }while(num!=0);
    return(ptr);
    }

    int main(){

    puts(convert(65,8));
    puts(convert(65,10));
    puts(convert(65,16));
    return 0;
    }

```

Output gives 101 ,65 and 41 ( i.e the number '65' represented in octal,decimal and hexadecimal notations respectively)

I pretty much understand whats going on but i have never come across anything like

```
*--ptr="0123456789abcdef"[num%base]

```

I understand its working but i dont understand how it is a valid notation. Someone please explain the 0123456789abcdef(literal character array) part here.