// Hello <p> blah blah<h1>bl blah
//using the line above i wrote this code(below) to attempt to gather just the
//<p>..i have no errors..but i also have nothing outputting to the screen?
//what is wrong with my syntax?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
string x = " ";
string temp = " ";
while (!infile.eof()) {
getline(infile, temp, '<');
getline(infile, x, '>');
x = x + '>';
cout << x << endl;
if (x == "<p>")
{
cout << "y" << endl;
}
}
but i am trying to store the string into an array and i am getting
Error: Access violation writing location(takes me into i believe assembly language )
1 2 3 4 5 6 7
//the error occurs within this function
//this function is within a while loop, whereas int i is being counted outside of the function
void arrayStow)string hold, int i){
string arr[7];
arr[i]=hold;
cout<<arr[i]<<endl;
}
cire thank again, but
1. when i run my prgram it prints the data i want with line spaces from the times i used getline and did not "==" what i requested. can i delete that space? the problem is I want to store the string into an array but just the desired string, now it stores what i wanted plus the empty strings into my array.