Skip to main content
GameDev.net gamedev.net
🔒 Locked

Newbie question

Started by Xces Apr 22, 2002 at 1:43 AM 0 replies 150+ views
Original Post
Xces
Xces
Hey guys, i have a newbie question. I want some information about the following code, (especially the "*") part. What does this code? -- char* cFilename; --- this is just an array of char? (like a string in VB?) and this? --- char **filelist = (char**)malloc(numFiles*sizeof(char*)); --- it creates a pointer-array of type char containing (numFiles*sizeof(char*)) pointers to a char? This is not a joke, just want to understand what the code does Thanx in advance, maybe an URL where to read this newbie stuff?
_DarkWIng_
_DarkWIng_
char* cFilename
this creates a pointer to char type ..like a string but it doesn''t do anything with it. cFilename is invalid(NOT empty) until you allocate some space for it (cFilename = new char[256]

char **filelist
is like a array of strings..

You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.