Original Post
I am reading a c++ tutorial and it uses the typedef word...
I dont get what it is for or why to use it.
struct house {
char nameofpropietary;
};
typedef struct house TheMillersHouse;
typedef TheMillersHouse *MillersHouse;
template< typename C, typename T >
class izfstream : public std::basic_istream< C, T >
{
public:
typedef C char_type;
typedef T traits_type;
typedef izfstream this_type;
typedef std::basic_istream< C, T > base_type;
typedef std::basic_ios< C, T > ios_type;
...
quote:
Original post by TheShadow
I am reading a c++ tutorial and it uses the typedef word...
I dont get what it is for or why to use it.
std::map<Player*,IPAddress*> playerIPs;
std::map<Player*,IPAddress*>::iterator it = playerIPs.begin();
std::map<Player*,IPAddress*>::iterator itEnd = playerIPs.end();
//etc.
typedef std::map<Player*,IPAddress*> PlayerIPMap;
typedef PlayerIPMap::iterator PlayerIPMapIt;
PlayerIPMap playerIPs;
PlayerIPMapIt it= playerIPs.begin();
PlayerIPMapIt itEnd= playerIPs.end();
//etc.
//typedef std::map<Player*,IPAddress*> PlayerIPMap;
typedef shadow::MyMap<Player*,IPAddress*> PlayerIPMap;
typedef PlayerIPMap::iterator PlayerIPMapIt;
//etc
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more