c
int validateAndConvert(const char* str) {
    int num = atoi(str);
    if (num == 0) {
        fprintf(stderr, "Error: Input must be a non-zero integer.\n");
        exit(EXIT_FAILURE);
    }
    return num;
}

// Usage in the main function
horizSubSampling = validateAndConvert(optarg);
