( 1 -  현재가 / 전일종가   )   * -100  = 전일종가대비 변동율

'프로그래밍 > C&C++' 카테고리의 다른 글

switch 문을 대체하는 function pointer  (0) 2019.01.01

1. sample 코드


#include <stdio.h>

typedef void (*func) ();


void foo1()

{

        printf("foo1\n");

}

void foo2()

{

        printf("foo2\n");

}

void foo3()

{

        printf("foo3\n");

}



void switch_with_fpointer( void (*pt2func)() )

{

        pt2func();

}


int main()

{

        func fpointers[] = { foo1, foo2, foo3 };


        fpointers[1]();


        switch_with_fpointer( &foo3 );

}



2. 자료

http://oopweb.com/CPP/Documents/FunctionPointers/Volume/CCPP/FPT/em_fpt.html

'프로그래밍 > C&C++' 카테고리의 다른 글

전일종가대비 % (변동율) 구하는 수식  (0) 2019.03.04

+ Recent posts