Problem with data not storing to be displayed.

Hello, I am a beginner programmer currently in class, and I'm having some trouble with an assignment.

I am to create a program that can store a type of media, in this case I have chosen games. Everything appears to be working so far except for one thing.

When I enter data to be stored and displayed later, the data I have input does not show up when I select "display" at the main menu of my program. Perhaps I am forgetting something that I'm not noticing. (should also note that the sort function hasn't been started as of yet.)

Any help would be appreciated. Thanks!

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
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;

struct VidyaGames {
    string Title;
    string Date;
    string Developer;
};

void getGames(VidyaGames array[], int &k);
void displayGames(VidyaGames array[], int &k);
void deleteGames(VidyaGames array[], int &k);
void sortGames(VidyaGames array[], int &k);



const int MAX = 150;

string Title;
string Date;
string Developer;

int main()
{
    char choice;
    VidyaGames array[MAX];
    bool kek = true;
    int k = 0;

    do
   
    {
    	
        cout << "Welcome to the 'Super Incredible Amazing Game Storage-o-Tron 5000(and one)." << endl;
        cout << " " << endl;
        cout << "Please select which task you would like to perform by typing in the " << endl;
        cout << "corresponding letter in the bracket: " << endl;
        cout << " " << endl;
        cout << "[I]nput a game into the list." << endl;
        cout << "[D]isplay the games you have stored." << endl;
        cout << "[S]ort the games you have stored." << endl;
        cout << "[R]emove a game from the list." << endl;
        cout << "[Q]uit the program." << endl;
        cin >> choice;

        switch (choice)
        {
            case 'I': getGames(array, k); break;
            case 'D': displayGames(array, k); break;
            case 'S': deleteGames(array, k); break;
            case 'R': deleteGames(array, k); break;
            case 'Q': kek = false; break;
            default : cout << "Hey. Remember when I gave you the specific options you were allowed to choose?" << endl;
            		   cout << "Maybe enter one of those?" << endl;
            		   cout << " " << endl;
        }
    }
    while (kek);
    cout << "You have killed me." << endl;

}
void getGames(VidyaGames array[], int &k)
{
    system("cls");
    VidyaGames tmp;
    char lel[100];
    cout << "Enter the title of your game: " << endl;
    getline (cin, Title);
    cout << "Enter the date your game was published: (Example: March 15th, 2014)" << endl;
    getline (cin, Date);
    cout << "Enter the developer of your game: " << endl;
    getline (cin, Developer);
    
}

void displayGames(VidyaGames array[], int &k)
{
	system ("cls");
    if (k==0)
        cout << "There is literally nothing in this list, as you have made the mental choice to not put anything in it yet." << endl;
    

    else if (k > 0) {
	for (int i=0; i < 0; i++)
    {
        cout << "Title: " << array[i].Title << endl;
        cout << "Release Date: " << array[i].Date << endl;
        cout << "Developer: " << array[i].Developer << endl;
   		 }
	}
}


void deleteGames(VidyaGames array[], int &k) {


    system("cls");
    char deleteChoice;
    if (k==0)
        cout << "There is literally nothing in this list, as you have made the mental choice to not put anything in it yet." << endl;
    else {
        cout << "Please type the name of the game you would like to delete: " << endl;
        cin >> deleteChoice;

    }
}

void sortGames(VidyaGames array[], int &k)
{

}
Topic archived. No new replies allowed.