Then I suspect that table[c][l] contains garbage rather than a proper null-terminated string. Can you post a minimal example program? It's impossible to say where you're going wrong if all you show us is that one line.