#!/usr/bin/env cscript #include void cast_column_index(char *column_index_string, int column_index) { int needle_column_index_string = 0; while (column_index > 0) { column_index_string[needle_column_index_string] = column_index % (26 + 1) + 'A' - 1; column_index /= 26; } } int main(int argc, char *argv[]) { char column_index_string[3 + 1] = {0}; cast_column_index(column_index_string, 1); printf("1 → %s\n", column_index_string); return 0; }