alexander Posted January 1, 2009 Report Posted January 1, 2009 In holiday spirit, what kind of geeky ways do you use to say this :) ? Quote
theblackalchemist Posted January 1, 2009 Report Posted January 1, 2009 // geeky way#include <iostream>using namespace std; int main (){ cout << "Merry Christmas"; return 0;} Thats the way.uh-uhi like ituh-uh Quote
alexander Posted January 3, 2009 Author Report Posted January 3, 2009 well if you want to go that route, hehe #include <iostream> using std::cout; class NewYear { private: int previous_year; int* year; public: NewYear() { previous_year = 2008; year = &previous_year; } void get_newyear() { cout << "Happy New " << ++(*this->year); } }; int main() { NewYear holiday; holiday.get_newyear(); } :hihi: Quote
theblackalchemist Posted January 3, 2009 Report Posted January 3, 2009 <html><head><title> Alex's wish</title></head><body bgcolor="aqua"><center><font face="Comic Sans MS" size=+3>Happy New Year</font></center><P></body></html> :hihi: Hey You ARE a computer wizard...i'm not TBA Quote
sanctus Posted January 5, 2009 Report Posted January 5, 2009 #include<iostream> using namespace std; int main(){ int year,i,bastard; char imstupid[80]; cout<<"guess the year we are in now"<<endl; cin>>year; if (year!=2008 && year !=2009 && year !=2010) { if (year==2008){ cout<<"looks like you missed something"; } if year==2009{ cout<<"wow, you are bright!Happy new year!!; } if year==2010{ cout<< "usually people like time to pass slower, what happened?"; } else{ for ( i=0;i<=year^2;i++){ bastard=0; cout<<"write"<<i<<"times:I have to remeber that it is 2009"<<endl; while(bastard<=i) { cout<<"write now:"<<endl; cin>>imstupid; bastard+=1; }//to be a real bastard, one could also introduce a spell check ;-) } Wonder if this would work, it is a few months since I last coded C++... Anyway Alex, what does the ++ in cout << "Happy New " << ++(*this->year); mean? Quote
alexander Posted January 5, 2009 Author Report Posted January 5, 2009 same thing it means in the i++ example, sanctus, it increments the count by one.... but it does so before the dereferenced pointer gets displayed, if you put it after the "year)" it will still show 2008 anyways, you can clean up some of that code, sanctus, you can use a select statement for the years sanctus it would mostly run, i think the "year xor 2" would not run as you expect though, ^ is a boolean xor operator :confused: it never hurts to init vars either Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.