why wont this work?
int main(int argc, char **argv) {
    char str[10];
    int num;
    scanf("%s %d", str, &num);

    if (num == -1) {
        printf("%s", str);
    } else if (0 <= num && num < 10) {
        printf("%s", *(&str+num));
    } else {
        printf("ERROR");
    }
}