목록전체 글 (317)
printf("ho_tari\n");
Stack
//#include #include #include "stack.h" int main() { Stack s1(10), s2(100); //s1.initStack(10); //s2.initStack(100); s1.push(100); s1.push(200); s1.push(300); //s1.tos = 0; //printf("s1 1st pop() : %d\n", s1.pop()); std::cout tos]; }
C++
2023. 8. 31. 12:06
Complex3 (여러연산자)
#include #include "complex.h" int main() { Complex c1; // (0.0, 0.0i) //Complex c2(3.0); // (3.0, 0.0i) Complex c2 = 3.0; Complex c3(3.0, 4.0); // (3.0, 4.0i) Complex c4 = c3; // Complex c4(c3); //Complex c4; // default constructor //c4 = c3; // assignment. //c1.real(c3.real()); //c1.imag(c3.imag()); c1 = c3; // c1.operator = (c3) or operator = (c1, c3) // c1 = c2 = c3; // daisy-chain c1 += c2; ..
C++
2023. 8. 31. 11:51