Original Post
I going to be useing this is reguards to a game but it is a general question i have about a TYPE in C++ lets say im storing an INT for some stat of a charicture in game i.e. strength so i have int str; now in reguards to memory usage if str is always between 0 and 255, which for my project it would be cant i assign it to TYPE char? i.e.... unsigned char str; Does this work? (someone told me i have to have unsigned in an email, (as i undetand it to make all the values + other wise half would be negative.) can i then still deal with the varible str as i would a int? do i have to type cast when doing math with it? i.e. dmg = (int)str + dex - enemy_def * acc; ummt that might not be the way to type set C++ but as i said im still learning it and im sure you have some way to do it. my understanding is that INT is 4-times as big as CHAR so if i want to save info to a memory card that has a fixed amout, say on some sort of game consol its best to do it this way. Also i wouldn't mind learning the best way to streamline things even if you have to make a bit unglyer code. comments are greatly welcome. btw if i overloaded my orginal question was can i just define a varible str as a unsigned char and hold a value in it of 0-255 and type set it when i need to do math (do i need to type set it?). thanks, Tom.