Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1.  
  2. typedef void (*EndFunction)(...);
  3.  
  4. void endFunction(double a, double b, int c, void* d) {
  5.    
  6. }
  7.  
  8. EndFunction someEndFunction = (EndFunction) endFunction;
  9.  
  10. void recieverFunction(SomeParamStack* stack, ...) {
  11.     if(stack->empty()) someEndFunction(/* вот тут нужно поместить список аргументов */);
  12.     else switch (stack->getNextType()) {
  13.         case(ST_INT) : {
  14.             recieverFunction(stack,/* аргументов */,stack->getInt(),);
  15.             break;
  16.         }
  17.        
  18.         case(ST_DOUBLE) : {
  19.             recieverFunction(stack,/* аргументов */, stack->getDouble());
  20.             break;
  21.         }
  22.        
  23.         case(ST_POINTER) : {
  24.             recieverFunction(stack,/* аргументов */, stack->getPointer());
  25.             break;
  26.         }
  27.     }
  28. }
  29.  
  30.  
  31.  
  32.  
  33. int main ( int argc, char **argv ) {
  34.     SomeParamStack stack;
  35.     stack->pushPointer(0);
  36.     stack->pushInt(3);
  37.     stack->pushDouble(2.2);
  38.     stack->pushDouble(1.1);
  39.     recieverFunction(stack);
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement