Every time I try to run this I get an abnormal termination error. Why? heh... I'm still new. This is assignment 2 in the intro to C++ class that assumes no programming knowledge, but only teaches you syntax (thankfully I'm also taking Intro to VB, where the teacher insist on teaching us how to program before we even touch VB).
Question
deck
Every time I try to run this I get an abnormal termination error. Why? heh... I'm still new. This is assignment 2 in the intro to C++ class that assumes no programming knowledge, but only teaches you syntax (thankfully I'm also taking Intro to VB, where the teacher insist on teaching us how to program before we even touch VB).
#include <iostream> // for cin, cout
#include <string>
using namespace std;
int main()
{
string gregorian;
cout << "Enter a date as dd mm yyyy: ";
cin >> gregorian;
cout << endl << endl;
cout << gregorian.substr( 0, 2 ) <<endl;
cout << gregorian.substr( 4, 6 ) <<endl;
cout << gregorian.substr( 7, 10 ) <<endl;
return 0;
}
Thanks,
~D
Link to comment
Share on other sites
2 answers to this question
Recommended Posts