Having trouble with a card game assignment

Hey guys, I have an assignment due soon, and I cant figure out how to read my text files into structs and then have them displayed onto the screen. The code compiles but when I try to display the cards or players it prints out a bunch of crazy squares with numbers in them. I have no clue on what to do.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
 /*-----------------------------------------------------------------------------------------*\
FILE NAME:	project3.cpp

DESCRIPTION:	A program that reads an array of characters from a file and shuffles them

EXIT CODES:	None

COMPILER:	Ubuntu text editor

Author		      Date			   
------------	   ------------	   
Brian Dudkowski	     09/10/14		  	
\*----------------------------------------------------------------------------------------*/
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
using namespace std;

struct card{
	char rank[5];
	char suit[7];
	int cvalue;
	char location[4];
	};
struct player{
	int total;
	char name[100];
	};
void choice_one();
void choice_three();
void get_menu();
int main()
{
	int choice;
	do{
		get_menu();//Displays the menu
		cout << "Enter you choice: ";// Could not get this to work in the menu function  
		cin >> choice;
		cout << endl << endl;
	}while (choice == 1 && choice == 2 && choice == 3 && choice == 4);
	switch (choice)
		{
			case 1: 
				{
					choice_one();
					break;
				}
			case 2: 
				{
					
					break;
				}
			case 3: 
				{
					choice_three();
					break;		
				}
			case 4: 
				{
					cout << "Goodbye!\n\n";
					break;
				}
				
		}

	return 0;
}

/* -----------------------------------------------------------------------------
FUNCTION:          void get_menu()
DESCRIPTION:       Displays the menu
RETURNS:           No return for void
NOTES:             Could not figure out how to include the user input for choice
----------------------------------------------------------------------------- */
void get_menu(){
	cout << endl << endl;
	cout << "Choose an option\n"
	     << "-------------------\n"
	     << "1. Print unshuffled deck to screen\n"
	     << "2. Print shuffled deck to the screen\n"
	     << "3. Print players\n"
	     << "4. Quit\n\n";
}

/* -----------------------------------------------------------------------------
FUNCTION:          void choice_one()
DESCRIPTION:       Reads the unshuffled deck and prints it on the screen
RETURNS:           No return for void
NOTES:             None
----------------------------------------------------------------------------- */
void choice_one()
{
	fstream fin;
	fin.open("unshuffled.txt");
	card unshuff[52];
	card *cptr;
	cptr = unshuff;
	for (int i = 0; i < 4; i++)
		{
			fin >> (*cptr).rank >> (*cptr).suit;
			cout << (*cptr).rank << (*cptr).rank << endl;
		}			
	fin.close();
	cout << endl << endl;
}
void choice_three()
{
	fstream fin;
	fin.open("players.txt");
	player pname[4];
	player *nptr;
	nptr = pname;
	for (int i = 0; i < 4; i++)
		{
			fin >> (*nptr).name;
			cout << (*nptr).name << endl;
		}			
	fin.close();
	cout << endl << endl;
}
Basically there are two text files; one has all of the cards in the deck (two heart, three heart, four heart...), the other text file has 4 player name(first name last name...). I have to read those two files into the arrays using pointers and display them to the screen.
Topic archived. No new replies allowed.