Quote Originally Posted by vart View Post
in C/C++ array indexes start at zero
so probably
for ( i = 0 ; i < ndata ;i++ )
does not seem to be the problem :-(