I am trying to parse a date stored as an array of characters. I have a problem to paerse the date with a loop otherwise it works fine. char date="20141018"; //the date is 10/18/2014 char _mypointer=date; char year= "YYYY"; char month="MM"; char day= "DD"; year=*my_pointer + 0; month=*my_pointer +1; What I want is the loop to do this but I am getting serios errors: int i,j =0; do i++; j++;} while(i<4 and j<4);
Jump to Post
You may have other errors ... best to post the whole section (or program).
/* char year= "YYYY"; char month="MM"; char day= "DD"; */ /* But ... I suspect you want to have: */ const char* year= "YYYY"; const char* month="MM"; const char* day= "DD";
All 8 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.