June 28th, 2013, 10:12 AM
OK, where is the real code?
raidus is spelled wrong, and there's a missing ) at the end of the statement.
> for(int i=0;i<rows;i++);
There is an extra ; at the end. What this means is the loop does nothing at all, then....
This becomes an out of bound memory access.
Also, remove all those casts on the result of malloc. It serves NO useful purpose in a correctly written C program (at worst, it hides a serious bug).
If you get warnings about "cannot convert void*", then stop using C++ to compile your C code.
If this really is C++ code, then in the first instance you should be using std::vector, or failing that, the new operator.