목록C++ Programming (41)
Creative Code
※main.cpp파일 #include #include "stack.h" int main() { Stack s1(10); Stack s2(100); s1.push(100); //구조체 자료는 인자를 전달할 때 오버헤드를 줄이기 위해 포인터를 쓴다. s1.push(200); s1.push(300); std::cout
※main.cpp파일 #include #include "stack.h" int main() { Stack s1(10); Stack s2(100); s1.push(100); //구조체 자료는 인자를 전달할 때 오버헤드를 줄이기 위해 포인터를 쓴다. s1.push(200); s1.push(300); std::cout
※main.cpp파일 #include #include "array.h" int main() { std::cout
※main.cpp파일 #include #include #include "list.h" int main(void) { List list; //initList(); list.insertFirstNode(4); //[4] std::cout next; Node *ptr2 = this->ptr; while (ptr){ if (ptr->data == data){ break; } ptr = ptr->next; ptr2 = ptr2 ->next; } if (ptr){ ptr2->next = ptr->next; delete ptr; } }
※main.cpp파일 #include #include "string.h" int main() { String s1; String s2 = "hello, world"; // String s2("hello,world"); //String s2 = 0;// NULL String s3 = s2; // String s3(s2); s1 = s2; String s4 = " IoT"; s1 = s2 + s4; s1 = "hello, "; //String tmp("hello, "); if (s1 == s2) std::cout
※main.cpp파일 #include #include "string.h" int main() { String s1; String s2 = "hello, world"; // String s2("hello,world"); //String s2 = 0;// NULL String s3 = s2; // String s3(s2); s1 = s2; String s4 = " IoT"; s1 = s2 + s4; s1 = "hello, "; //String tmp("hello, "); if (s1 == s2) std::cout