Print Cards in Chinese

  1. Extend your program for printing cards by overloading the function print_card() with a Chinese version.
  2. If the function is invoked as print_card(n, "Chinese"), the output is displayed in Chinese, such as "梅花2 方塊A 紅心十 黑桃K 黑桃A".
  3. Note that when you compare whether two strings are the same, you should use the "strcmp()" function, instead of comparing two strings directly. Running the following program and you will see why.
    
    int main()
    {
      char a[] = "HELLO";
      char b[] = "HELLO";
      if (b == a)
          cout << "The same\n";
      else
          cout << "Different\n";
    
    }
    
    
  4. You may test your print_card() function with the following main program:
    
    int main()
    {
        int i;
        int my_card[5];
        for (i=0; i<5; i++)         // Get_Five
            cin >> my_card[i];
    
    
        for (i=0; i<5; i++)
        {
            print_card(my_card[i]);
            cout << (i==4 ? '\n' : '\t');
        }
        for (i=0; i<5; i++)
        {
            print_card(my_card[i], "Chinese");
            cout << (i==4 ? '\n' : '\t');
        }
    
        return 0;
    }