1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

reconstitute blob as matrix

Discussion in 'C++' started by tactilesounds, Sep 6, 2010.

  1. tactilesounds

    tactilesounds New Member

    Joined:
    Sep 6, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi All,

    I'm trying to reconstitute a blob of data as a 32x32 array - I'm not getting any compiler warnings (using VC++ 2008), but my program is crashing. Can anyone see what I might be doing wrong here:
    Code:
    	if(pinStorage.isUpdated()) // if the blob is updated
    	{
    		typedef float (*floatArray)[32][32];
    		floatArray ptr = (floatArray) pinStorage.rawData(); // get blob as array of pointers
    		for (int y = 0; y < 32; y++)
    		{
    			for (int x = 0; x < 32; x++)
    			{
    				float tmp = (*ptr)[y][x]; // get variable pointed to?
    				patternArray[y][x] = tmp; // assign to private variable. This line causes crash.
    			}
    		}
    	}
    
    Thanks in advance,
    Jonathan.
     

Share This Page