Hey,
What i'm trying to do is to use the string.find command with a pointer.
Here is the code that i've written sofar.
#include <iostream>
#include <string>
using namespace std;
int main()
{
string one[3];
string two[3];
string searchalt;
string *point;
int search[3];
int a = 0;
size_t found;
cin >> searchalt;
if (searchalt == "1")
*point = one[a];
if (searchalt == "2")
*point = two[a];
while (a <= 2)
{
found = *point.find("test"); //Here is the error
if (found != string::npos)
{
search[a] = 1;
a++;
}
else
{
a++;
}
}
}
The error says: untitled.cpp:21: error: request for member ‘find’ in ‘point’, which is of non-class type ‘std::string*’
Does anyone know how to fix it?