OpenQNX :: The QNX Community Portal

Sep 07, 2008 - 07:41 AM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 34 unlogged users and 1 registered user online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Diplom@t
Post subject: Strange indexing error  PostPosted: Sep 17, 2007 - 03:40 PM
New Member


Joined: Sep 17, 2007
Posts: 1

I'm porting a game to the QNX 6.3 and using compiler ver. 3.4.4
I have faced very strange error:
the code below doesn't work:

UINT pIndicies = new UINT[ m_uiNum ];
for(UINT j=0; j<m_uiNum; j++)
{
fscanf( pFile, "%d", &(m_pIndicies[j]) );
}

and at the same time the following code works fine:

UINT pIndicies = new UINT[ m_uiNum ];
for(UINT j=0; j<m_uiNum; j++)
{
fscanf( pFile, "%d", &value );
m_pIndicies[j] = value;
}


What's the problem?
 
 View user's profile Send private message  
Reply with quote Back to top
mario
Post subject: Re: Strange indexing error  PostPosted: Sep 17, 2007 - 04:22 PM
QNX Master


Joined: Sep 01, 2002
Posts: 2849

Diplom@t wrote:
I'm porting a game to the QNX 6.3 and using compiler ver. 3.4.4
I have faced very strange error:
the code below doesn't work:

UINT pIndicies = new UINT[ m_uiNum ];
for(UINT j=0; j<m_uiNum; j++)
{
fscanf( pFile, "%d", &(m_pIndicies[j]) );
}

and at the same time the following code works fine:

UINT pIndicies = new UINT[ m_uiNum ];
for(UINT j=0; j<m_uiNum; j++)
{
fscanf( pFile, "%d", &value );
m_pIndicies[j] = value;
}

What's the problem?


I don't understand why this code compile in the first place. UINT pIndices should be UINT* pIndices. And where did you get version 3.4.4?
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.