Skip to content

Instantly share code, notes, and snippets.

@kkdai
Created February 5, 2014 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkdai/8819946 to your computer and use it in GitHub Desktop.
Save kkdai/8819946 to your computer and use it in GitHub Desktop.
class foo_class
{
foo_class()
private:
int a=0;
public:
int b=0,
void foo_fun1();
}
void foo_fun1():a(2),b(3)
{
// What is a, what is b?
a=b;
//waht is a, what is b?
}
@kkdai
Copy link
Author

kkdai commented Feb 5, 2014

The answer is a, b default value is foo_fun1 is not define the priority.
So, don't write code like this, because every compiler has different result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment