Set an array of int
to the same value (C99, Linux, BSD, OSX)
Instead of
int a[n]=...,x=...;for(int i=n;i--;)a[i]=x
Try something like
int a[n]=...,x=...;wmemset(a,x,n);
On MSVC on Windows, wmemset()
works on arrays of short
instead of int
.