I was recently learning to use `struct` datatype in c++. I know how the basics of `struct` datatype work and how to manipulate its variables. But I was wondering how would I determine the end of `struct` datatype array. For example consider the code below:

```
struct PersonDetails
{
    string name, address;
    int age, number;
}

```

Now in c++ program I create an array of struct type as follows:

```
PersonDetails Data[500];

```

Now consider that I have 30 records in data array and I have to display these records by looping through data array's index. So how would I determine that I have to loop through only first 30 indexes as the data is only stored in these indexes. As in `char` array we compare all indexes with `'\0'` to determine the end of array. Then what method will we use for `Data[]` array?

An edit that I have no idea about Vectors and the project i am working on requires me to use basics of c++(functions, control structures, loops, etc.).