#include <stdio.h>

#define BUFF_SZ 256

void rev_string(char s[]) {
    int str_sz = 0;
    char tmp = 0;

    do {
        str_sz++;
    } while (s[str_sz] != '\0' && str_sz < BUFF_SZ);
    str_sz--; // remove null terminater from count

    for (int i = 0; i < str_sz/2; i++) {
        tmp = s[str_sz - 1 - i];
        s[str_sz - 1 - i] = s[i];
        s[i] = tmp;
    }
}

int main(void) {
    char buff[BUFF_SZ] = {0};

    printf("Input String: ");
    fgets(buff, BUFF_SZ, stdin);

    printf("Got: %s\n", buff);

    rev_string(buff);

    printf("Rev: %s\n", buff);

    return 0;
}
