목록C++ (19)
Typing diary
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 #include #include using namespace std; int main() { char ch[] = { "char" }; //string 생성자 string a; //string() string b("name"); //string(string& str) string c(ch); //stinrg(char* s) string d(ch, 2); //string(char *s,int n) cout
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566#include #include using namespace std; class Player{ string name;public: void setname(); string getname() { return name; }}; void Player::setname(){ cout > name;} class WordGame{ Player *player; int playerNum; string after, before;public: WordGame() { after = "아버지"; } void r..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 #include #include using namespace std; class Date { int Year, Month, Day; public: Date(int year, int month, int day) { Year = year; Month = month; Day = day; } Date(string date); void show(); int getYear() { return Year; } int getMonth() { return Month; ..