C++ Primer學習筆記二

	vector<int>	a(10,0);
	for(vector<int>::iterator itor=a.begin();itor!=a.end();itor++)
		*itor=1;
	
	/* *itor can't changed */
	for(vector<int>::const_iterator itor=a.begin();itor!=a.end();itor++)
		cout<<*itor;
	/* itor itself can't changed,but *itor is changeable */
	const vector<int>::iterator itor;
	
	bool singal;
	cin>>singal;

  計算數組長度數組

	unsigned a[]={1,2,3,4,5,6,7,8,9,0};
	cout<<sizeof(a)/sizeof(unsigned);
相關文章
相關標籤/搜索