I have a program to write that takes in the date in ##/##/## format. I then write the month day, year output. What I'm totally lost on is how to get from reading the char array to integer numbers?? Big time Lost! Need help!
fiberoptik
0
Newbie Poster
Recommended Answers
Jump to PostIs this C or C++?
Jump to PostHere's a start:
#include <cstdlib> #include <iostream> #include <sstream> #include <string> using namespace std; int main() { istringstream in ( "03/30/05" ); int m, d, y; in>> m; if ( in.peek() != '/' ) { cerr<<"Invalid format"<<endl; return EXIT_FAILURE; } in.ignore(); in>> d; if ( in.peek() != …
All 5 Replies
Narue
5,707
Bad Cop
Team Colleague
fiberoptik
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
fiberoptik
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.