int main ( int argc, char *argv [] ) { boost::signal<void ()> sig; boost::signals::scoped_connection c1, c2; c1 = sig.connect ( HelloWorld ()); std::swap ( c1, c2 ); return 0; }
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HelloWorld(); return 0; }
int main() { int i,first,second; printf("Enter a number: "); scanf("%d",&first); printf("Enter a second number: "); scanf("%d",&second); i=Largest(first,second); if (i == 1) printf("First number is larger\n"); else if (i == 2) printf("Second number is larger\n"); else printf("Same number\n"); printf("%lf\n",SevenPointSeven()); HelloWorld(); HelloWorld(); }
void disconnect_example() { boost::signals2::signal<void ()> sig; //[ disconnect_code_snippet boost::signals2::connection c = sig.connect(HelloWorld()); std::cout << "c is connected\n"; sig(); // Prints "Hello, World!" c.disconnect(); // Disconnect the HelloWorld object std::cout << "c is disconnected\n"; sig(); // Does nothing: there are no connected slots //] }
int main(int argc, char const *argv[]) { printf("Test: C\n"); const long a = 2; const long b = 40; printf("Sum = %lld\n", Sum(a, b)); printf("Hello World = %s\n", HelloWorld()); // printf("AddDot = %s\n", AddDots("Test")); printf("Done.\n"); return 0; }
void __RPC_STUB TestServer_HelloWorld( PRPC_MESSAGE _pRpcMessage ) { MIDL_STUB_MESSAGE _StubMsg; short data; RPC_STATUS _Status; ((void)(_Status)); NdrServerInitializeNew( _pRpcMessage, &_StubMsg, &TestServer_StubDesc); RpcTryFinally { RpcTryExcept { if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION ) NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] ); data = *(( short __RPC_FAR * )_StubMsg.Buffer)++; if(_StubMsg.Buffer > _StubMsg.BufferEnd) { RpcRaiseException(RPC_X_BAD_STUB_DATA); } } RpcExcept( RPC_BAD_STUB_DATA_EXCEPTION_FILTER ) { RpcRaiseException(RPC_X_BAD_STUB_DATA); } RpcEndExcept HelloWorld(data); } RpcFinally { } RpcEndFinally _pRpcMessage->BufferLength = (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer); }
void block_example() { boost::signals2::signal<void ()> sig; //[ block_code_snippet boost::signals2::connection c = sig.connect(HelloWorld()); std::cout << "c is not blocked.\n"; sig(); // Prints "Hello, World!" { boost::signals2::shared_connection_block block(c); // block the slot std::cout << "c is blocked.\n"; sig(); // No output: the slot is blocked } // shared_connection_block going out of scope unblocks the slot std::cout << "c is not blocked.\n"; sig(); // Prints "Hello, World!"} //] }
int main() { HelloWorld(); return 0; }