Sign in to follow this  
nuclear123

calling function outside main()

Recommended Posts

[font="monospace"][size="2"]
[code]
#include <windows.h>
#include <stdio.h>

HWND hg = FindWindowA(NULL, "Calculator");

int main()
{
printf("hg : %p", hg);
return 0;
}[/code]





[/size][/font]
[font="monospace"][size="2"]im confused on the following cod snippet. Where and how does FindWindowA() get executed if it's outside the entrypoint function main?[/size][/font]

Share this post


Link to post
Share on other sites
That's implementation defined. It may be called as part of the initialization code that runs before main() begins execution, or it may be executed sometime after main() starts but before the variable is first used.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this