분류 전체보기

    함수에 같은 타입의 인수 여러개 받기

    void foo(char *fmt, ...) { va_list ap, ap2; int d; char c, *s; va_start(ap, fmt); va_copy(ap2, ap); while (*fmt) switch(*fmt++) { case 's': /* string */ s = va_arg(ap, char *); printf("string %s\n", s); break; case 'd': /* int */ d = va_arg(ap, int); printf("int %d\n", d); break; case 'c': /* char */ /* Note: char is promoted to int. */ c = va_arg(ap, int); printf("char %c\n", c); break; } va_en..

    image masking

    CGImageRef myMaskedImage; const float myMaskingColors[6] = {124, 255, 68, 222, 0, 165}; myColorMaskedImage = CGImageCreateWithMaskingColors (image, myMaskingColors); CGContextDrawImage (context, myContextRect, myColorMaskedImage); CGImageRef myMaskedImage; const float myMaskingColors[6] = { 0, 124, 0, 68, 0, 0 }; myColorMaskedImage = CGImageCreateWithMaskingColors (image, myMaskingColors); CGCon..

    iphone

    // 세로 if (toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){ NSLog(@"vertical"); rect = CGRectMake(0.0, 0.0, 1024.0, 768.0); topMBar.frame = CGRectMake(0.0, 0.0, 1024.0, 44.0); // 가로 } else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRigh..