Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
0 Endorsements
Ranked #37.0K
~2K People Reached
Favorite Forums
Favorite Tags
c++ x 5

4 Posted Topics

Member Avatar for porterrj

These examples are overly complicated. I found a simple one that totally handles leap years. from: [URL="http://www.zedwood.com/article/102/cpp-checkdate-function-for-date-validation"]c++ checkdate date validation[/URL] [code=c] bool checkdate(int m, int d, int y) { //gregorian dates started in 1582 if (! (1582<= y ) )//comment these 2 lines out if it bothers you return false; …

Member Avatar for NathanOliver
0
463
Member Avatar for sunderthomas

[code=c++] #include <iostream> #include <vector> #include <string> using namespace std; vector<string> explode( const string &delimiter, const string &explodeme); int main(int argc, char *argv[]) { string str = "I have a lovely bunch of cocoa nuts"; cout<<str<<endl; vector<string> v = explode(" ", str); for(int i=0; i<v.size(); i++) cout <<i << " …

Member Avatar for monkey_king
0
163
Member Avatar for JameB

just write your own itoa. [code=c++] #include <iostream> #include <string> using namespace std; string itoa(const int &integer,int base=10) { if (integer==0) return string("0"); string a; int start, digits, piece; //count digits digits=0; piece=((integer<0)? 0-integer : integer); while( piece > 0 ) { piece-= (piece%base); piece/=base; digits++; } start=((integer<0)? 1 : …

Member Avatar for blacklight332
0
968
Member Avatar for koushal.vv

C works in MFC right? (sprintf/sscanf) [code=c] int main(int argc, char*argv[]) { int m,d,y; sscanf("%d/%d/%d", &m, &d, &y); if (checkdate(m,d,y)) { printf("valid\n"); } else { printf("invalid\n"); } } bool checkdate(int m, int d, int y) { //gregorian dates started in 1582 if (! (1582<= y ) )//comment these 2 lines …

Member Avatar for John A
0
510

The End.