ofi's blog

By ofi, history, 7 years ago, In English
vector<int> v;

int f()
{
	v.push_back(-1);
	return 1;
}
int main()
{
	v.push_back(0);
	cout<<v[0]<<endl;
	v[0]=f();
	cout<<v[0]<<' '<<v[1]<<endl;
		
	return 0;
}

expected output:

0

1 -1

output:

0

0 1

Full text and comments »

  • Vote: I like it
  • +49
  • Vote: I do not like it