Difference between revisions of "CPP/Typedef"

From ProgrammingExamples
< CPP
Jump to: navigation, search
(Created page with '==Typedef.cpp== <source lang="cpp"> #include <iostream> typedef std::pair<unsigned int, unsigned int> IndexPair; int main(int argc, char *argv[]) { IndexPair A; A.first = 2…')
 
(No difference)

Latest revision as of 09:19, 23 June 2010

Typedef.cpp

#include <iostream>
 
typedef std::pair<unsigned int, unsigned int> IndexPair;
 
int main(int argc, char *argv[])
{
  IndexPair A;
  A.first = 2;
  A.second = 4;
 
  //std::cout << A << std::endl;
  std::cout << A.first << std::endl;
  std::cout << A.second << std::endl;
  return 0;
}