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