I have been a member here for about 3 weeks, and I have gotten some good info from the tutorials section and looking at other save editors. I have written a save game editor in vb. It works perfectly fine, but I have read that C++ is better to program in, so I am trying to learn it to rewrite my editor. I found a source code that I am making changes to, however the code is reading in the opposite endian of what I need. It is reading the data as 4100 instead of 0041, so instead of getting an HP variable of 65, it is giving me 166 (the actual data is 16640, but the textbox length is set to 3, so it only displays the first 3 numbers). Here is the code I am using to read the data:

Code:
for(i = 0;i < 7;i++)
		{
		lseek(handle,6169 + i * 80,SEEK_SET);
		read(handle,&(character[i].hp),2);
		read(handle,&(character[i].maxhp),2);
		read(handle,&(character[i].mp),2);
		read(handle,&(character[i].maxmp),2);
		read(handle,&(character[i].power),1);
		read(handle,&(character[i].stamina),1);
		read(handle,&(character[i].speed),1);
		read(handle,&(character[i].magic),1);
		read(handle,&(character[i].hit),1);
		read(handle,&(character[i].evade),1);
		read(handle,&(character[i].mdef),1);
		read(handle,&(character[i].level),1);
		read(handle,&(character[i].xp),3);
Does anyone know how to handle switching endians? I have found a few things about switching using swaps or other functions, but since I am so new to C++ I can't seem to get them to work properly. Let me know if I need to provide more of the code or not.

Thank you for any help that you can give me.