I don't know why the parameters I gave you didn't work. You did change the parameters for all the function calls, not just for card3, right? As for the code that your teacher gave you, I'm sure you must have copied it incorrectly.
The problem that probably caused your run time error is line 5. You are going through the loop ten times. Each time through the loop, you read in two cards. The line just isn't that long, and reading what isn't there is causing an error.
You are still using the substr function incorrectly. Check the reference page, the second parameter is supposed to be the length of the sub-string.
http://www.cplusplus.com/reference/string/string/substr/
Think about what values endcard1 and endcard2 has each time you go through the loop.
1. endcard1 = 2, endcard2 = 5
2. endcard1 = 8, endcard2 = 11
etc.
So your sub-strings are going to be much longer than what you probably want.
Your conditions are still incorrect (probably). I think you're trying to read in whole cards, so card1 and card2 are going to be at least two characters long. Your conditions in the if statement are never going to be true.
Is there some reason you must use the find and substr functions? The stringstream method I showed earlier works just fine.
EDIT: Noticed some more possible errors in the code.
On line 9,
startPos = endcard1++;
means that you set startPos equal to endcard1, then increment endcard1 by 1. You probably meant to do
startPos = ++endcard1;
which would mean incrementing endcard1 by 1 first, then setting startPos equal to endcard1. I am not sure why you need line 14.
On line 13, you probably meant
string card2 = data.substr(startPos,endcard2);
instead of
string card2 = data.substr(startPos,endcard1);
. Although that would still be using the substr function incorrectly.