Hey!
I now im pretty newbie but i have a problem in my code
Code:
void search(void)
{
char *p, *n, line[5000], name[64];
int a = 1;
p = line;
n = name;
cout << "\nWrite the name on the person you want to view." << endl;
cin >> name;
clrscr();
ifstream input_fil("person.dat", ios::in);
if (input_fil.fail())
{
cerr << "The file couldnt be opend!\n" << endl;
a = 0;
}
input_fil >> line;
if (a)
{
while (a)
{
if (*p == *n)
{
cout << *p;
while (*p != '|')
{
cout << *p;
p = p++;
}
a = 0;
}
else
p = p++;
}
}
input_fil.close();
}
This is suposed to open the file "person.dat" in the array "line", and then write everything to the screen, from the name the user type, to the end icon '|'.
But it dont?!
Plz help me!