View Single Post
Old 04-15-2005, 06:35 PM   #1 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 705
DJMaze is on a distinguished road
empty pointers are not empty using 'new' operator

I have a structure and when i use the new operator to create it somehow the pointers inside it are not empty.
Instead i must force each to be NULL.

PHP Code:
typedef struct {
  
TCHAR         *FileName;
  
int            Index;
  
int            Frequency;
my_struct;

my_struct *test = new my_struct;

if (
test->FileName != NULL) {
  print(
"Odd pointer found");
  return -
1;

Could someone explain this to me ?
I even tried to use malloc() instead.
DJMaze is offline   Reply With Quote