title: Exception code c0000005 app crash
body: <p>Good morning to everybody.
  I'm working on a CUDA project in which I need to manipulate some 2D arrays that are dynamically created by using the <code>malloc</code> function.</p>
  
  <p>I report here the entire code of the file on which I'm currently working on:
  <a href="http://pastebin.com/mcFdH4kQ" rel="nofollow">http://pastebin.com/mcFdH4kQ</a></p>
  
  <p>When I try to execute the code after generating the .exe file, I encounter an ACCESS_VIOLATION error that causes app crash. Probably, the main problem deals with the function called <code>setArrayItemAtXY</code>thanks to which I'd to save a given integer value within the matrix I passed as parameter, in a pre-determined (x,y) position.</p>
  
  <p>Is there any problem regarding the syntax? Which may be the issue?</p>
  
  <p>Thank you in advance for your reply.</p>