Skip to content

Instantly share code, notes, and snippets.

@kkdai
Created February 14, 2014 01:34
Show Gist options
  • Select an option

  • Save kkdai/8994260 to your computer and use it in GitHub Desktop.

Select an option

Save kkdai/8994260 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <stdio.h>
class L
{
private:
int a1=1;
public:
L():a1(2), a2(a1) //Don't use like this, a2 result depends on compiler
{}
~L()
{ }
int a2=1;
void foo1()
{
printf("fun1");
}
};
int main(int argc, const char * argv[])
{
L *l1 = NULL;
l1->foo1();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment