All Forums
 Microsoft Windows CE
 eVC Application Development
 global scope with new operator
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ceuser

7 Posts

Posted - 30 May 2008 :  14:19:05  Show Profile  Email Poster
The load of the "new" allocated memory within the function defined works as expected, but I don't know the format to access in another function?
I'm not deleting since I need throughout my program.

Right now I have a global declaration of
TCHAR (*ffileuserkeywords)[64];

Within a function allocate/load memory...which works
TCHAR (*ffileuserkeywords)[64] = new TCHAR[rows_fileuserkeywords * columns][64];

Other functions trying to access show a null ptr for ffileuserkeywords
extern TCHAR (*ffileuserkeywords)[64];


beitman

63 Posts

Posted - 02 Jun 2008 :  08:59:59  Show Profile  Email Poster
You declared two variables with the same name. One has global scope and the other has function scope. You initialized only one of them.

try:

ffileuserkeywords = new TCHAR[rows_fileuserkeywords * columns][64];

A mulitiplication typically idicates another dimension to the array. This is an array of pointers to arrays of TCHAR[64], which seems odd so you might want to double check it.
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000