I am receiving the following error when trying to use a pointer to an array that is defined using a structure. If anyone can explain why I'm receiving this error I would really appreciate it.
no match for `* std::string&' operator
Here is the structure that the array is defined in
Code:
#include <iostream>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <string>
using std::cout;
using std::cin;
using std::endl;
using namespace std;
const int IN_VEHICLE = 100;
struct vehicles_in{
string inVin;
int inPassengerCount;
string inLuxury;
int inMpg;
char inType;
}new_vehicle [IN_VEHICLE];
Here are the functions that are using a pointer to the new_vehicle array
Code:
void init_list()
{
int t;
for (t=0; t<IN_VEHICLE; t++)*new_vehicle[t].inVin = '\0';
}
void enterNewVehicle()
{
int i;
for (i=0;i<IN_VEHICLE; i++)
if (!*new_vehicle[i].inVin) break;
if (i==IN_VEHICLE){
cout << "This list is full.\n";
return;
}