Quantcast
Channel: Cemetech
Viewing all articles
Browse latest Browse all 75370

General Programming :: RE: [C] Open different files for different languages

$
0
0
Author: Tari
Posted: 23 Mar 2013 10:58:54 pm (GMT -5)

calc84maniac wrote:
You're really not supposed to modify string constants (they're called constants for a reason).
They're only constant if declared const, which these aren't. It's fine.

Oh, it's a pointer rather than a buffer. Yeah, that's bad. That should produce a few warnings when compiled.

calc84maniac wrote:
It might be generally better if you define a char array to hold the filename and do something like sprintf(filename, "res/%s/room/%03d.txt", lang, roomNumber);
Agreed, this is probably the cleanest way to do it.
_________________


Ask questions the smart way· タリ


Viewing all articles
Browse latest Browse all 75370

Trending Articles