Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
calling conventions and using an override class to change another classes values
#include <stdio.h> #include <string.h> class test{ public: int i = 4; void thiscallfunc(int,test); }; class test2{ public: int p = 5; void thiscallfunc(int,test); }; /* */ void test::thiscallfunc(int o, test t) { i = o + t.i; } void test2::thiscallfunc(int l, test t) { p = l; } int _fastcall fastfunc(int a,int b, int c, float d, float e){ return a+b+c+3-d+e; } int _stdcall stdfunc(int a,int b, int c, float d, float e){ return a+b+c+4-d+e; } int _cdecl cfunc(int a,int b, int c, float d, float e){ return a+b+c+5-d+e; } int main() { int x,y,z; test t; test t2; t2.i = 500; //t2 interpreted as test2 class instead of test class, this function calling happens on addreses of test2, i hope test2* t2p = (test2*)&t2; //these 2 functions differ t2p->thiscallfunc(2000,t); t.thiscallfunc(10,t); printf("t2 value: %i",t2.i); //yo x=fastfunc(1,4,7,5.0,1.0); y=stdfunc(2,5,8,10.0,1.0); z=cfunc(3,6,9,5.0,2.0); x += 1; y += 2; z += 3; }
run
|
edit
|
history
|
help
0
ㅇㅇ
Static cast of Enum
"Mostly invalid states" and unordered_set
Revers find file in windows
ADL of operator expression & unqualified function call
Replace all spaces in a string in C++
3 sayinin toplami
MSVC14 <exception> header
virtual inheritance
wrong up