Be me sitting in data structures

>Be me sitting in data structures
Teacher: You cant call a private member function from within main()

me: (pic related)

why can't you just use a goto

>you didn't even pass a this pointer to it
>thinking you're hot shit

you aren't calling a private function, you're calling an arbitrary pointer that happens to be where the code for your private function is located.

I bet you're that one kid who always asks "intellectual" (read: tryhard) questions to the prof to attempt to look smart.

try doing that in java

...

bingo

getting output that seems to be a thing is not necessarily that thing

now call a private function with arguments and a return value and make it work

Jreeves, the wild lad at it again!

setting registers is actually very hard

>using namespace std;

>freshman regurgitating baseless urgings by professor
He's not writing a library. Fuck off.

here you go buddy
class cx {
public:
virtual void function1() {
printf("hey\n");
};

virtual void function2()
{
printf("hehe lol\n");
};
};

int main()
{
cx * a = new cx();
DWORD* a_vtbl = *(DWORD **)a;
((void(*)()) a_vtbl[1])();
}

whoops, forgot the private, just add it above function2, and it will work

Wait, what subroutine is at 0x400824?

>unnecessairly declare them as virtual and decrease performance just so you can call them from the vtable instead of literally calling the function by address with a this pointer
lmaoing @ ur life

The point was doing it without needing to know the address of the second function

I wonder what Prof Huang would have to say if he knew that J. Reeves was talking shit about him online

MyClass::Private()

better throw this in archive.is or whatever quick

What the fuck is a "runction"?

>sepples

>mfw i insert code at 0x400824

Whoa, how many hacker points did he give you?

I'd probably go ahead and give you 2448 (which is 1 more than 1337 on each unit)

>what is reflection

seems like you are too retarded to even understand what your professor is trying to explain. well, you wont make it past the first year anyway.

Mfw people pay to ''''''''''''study'''''''''' computer shit at an institution

Lol

Worse is that they don't learn anything and instead make shitty code that's easily exploitable.