Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
MSVC initializer code
// Initializer/finalizer sample for MSVC and GCC/Clang. // 2010-2016 Joe Lowe. Released into the public domain. #include <stdio.h> #include <stdlib.h> #pragma section(".CRT$XCU",read) static void init() { printf("initialize 1\n"); } __declspec(allocate(".CRT$XCU")) static void (*init_)() = init; static void init2() { printf("initialize 2\n"); } __declspec(allocate(".CRT$XCU")) static void (*init2_)() = init2; int main( int argc, char** argv) { printf( "main\n"); return 0; }
run
|
edit
|
history
|
help
0
sharedptr emptiness
Error defining lambda inside namespace
Cannot allocate an array of constant size 0
base call virtual
operator new / delete
codecvt wide string conversion with multibyte chars and locale + concatenation
Visual C++ template instantiation
fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
Double_wrapper vc++
Two-phase sample with Visual C++ 2015