Array and Structure Issues

I'm trying to write an input function which takes in a struct array of type video, and it size, as its formal parameters and then get the titles of five movies from the user and store them in the proper member variable for each instance of the five movies but I'm completely stumped. Can anyone please help me with this?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>

typedef struct _VIDEO {
  static const int MAX_TITLE = 10;

  int nSize;
  char szTitle[MAX_TITLE];
} VIDEO, *PVIDEO;

void GetVideoTitles(PVIDEO pVideos, int nSize)
{
  const int c_nVideos = 5;
  int       i = 0;

  for(; i < c_nVideos; i++)
  {
    pVideos[i].nSize = nSize;
    std::cin >> pVideos[i].szTitle;
  }
}
The technique of doing

1
2
3
typedef struct Tag1 {
 // ... blah blah blah
} Tag2;


is ill-advised in C++.

Just do

1
2
3
struct Tag2 {
 // ... blah blah blah
};


instead.
Topic archived. No new replies allowed.