Well I am trying to mimic my old c++ code of the map readers. But I am having lot of trouble here is what is suppose to happen:
3 parts to the string FilePath
1.The file path to where to find the map.
2. The file name
3. The ending (.txt).
all of these is then merged with strcat. As maps change every time a player moves the file name changes. E.g.
c:\ (file path).
1 (the map name)
.txt (map ending).
These strings are then merged into 1 file path "c:\1.txt"
My function for this works fine which can be found here:
All of this works fine if I put in the string my self .e.g chnagemap(3); will make it read from the file c:\3.txt. How ever when I try and use a variable for the value it does not work e.g.Code:char changeMap(char mapName[5]){ strcat(mapPath,mapName); strcat(mapPath,mapEnd); return(mapPath[50]); }
changeMap(player.map);
any help on the matter?
thanks
zidsal