목록분류 전체보기 (318)
printf("ho_tari\n");
#include #include "string.h" int main() { String s1; String s2 = "hello, world"; // String s2("hello, world"); //String s2 = 0; String s3 = s2; // String s3(s2); s1 = s2; // s1 = s1; // self assignment?? s1 = "hello, "; // String tmp("hello, "); s1 = tmp; tmp.~String(); String s4 = " IoT"; s1 = s2 + s4; if (s1 == s2) { std::cout
#include #include "shape.h" #include "rectangle.h" #include "circle.h" #include void printArea(const Shape *ps) { std::cout
#include int main(void) { int a = 0x12345678; //int *p; char *p; //p = static_cast(&a); p = reinterpret_cast(&a); printf("*p : 0x%x\n", *p); return 0; }
#include int main(void) { int man, woman; printf("Man: "); scanf("%d", &man); printf("Woman: "); scanf("%d", &woman); double manratio, womanratio; manratio = static_cast(man) / (man + woman) * 100; womanratio = static_cast(woman) / (man + woman) * 100; printf("----------------------------\n"); printf("Ratio of Man : %.2f%%\nRatio of Woman : %.2f%%\n", manratio, womanratio); return 0; }
#include #include "safeArray.h" #include "invalidIndex.h" int main() { int nums1[] = {1,2,3,4,5}; SafeArray arr1(nums1,5); for (int i = 0; i
#include #include "boundArray.h" int main() { BoundArray arr1; //BoundArray arr1(0,10); [0,10) BoundArray arr2(100); // BoundArray arr2(0,100); [0,100) BoundArray arr3(1,11); // index[1,11) for (int i = arr3.lower(); i
#include #include "safeArray.h" #include "array.h" int main() { int nums1[] = {1,2,3,4,5}; SafeArray arr1(nums1,5); for (int i = 0; i