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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice