Z
zl2k
hi, all
If I am using gcc, is the sequence of excution in "if" the same as what
I wrote? Here is an example:
vector<int> v;
unsigned short a;
.....
if (a < v.size() && v[a] > 0)
cout<<v[a];
I expect that the "a < v.size()" will excute first so that I won't get
into the segmentation error in cas of a > v.size(). But I am not sure
if gcc will do in this way. Thanks for your comments.
zl2k
If I am using gcc, is the sequence of excution in "if" the same as what
I wrote? Here is an example:
vector<int> v;
unsigned short a;
.....
if (a < v.size() && v[a] > 0)
cout<<v[a];
I expect that the "a < v.size()" will excute first so that I won't get
into the segmentation error in cas of a > v.size(). But I am not sure
if gcc will do in this way. Thanks for your comments.
zl2k