M
mosfet
Hi,
how can i make the difference between a char* and a char[x]
because I need to do this
void myfun(char * tab)
{
int nTmp;
nTmp = sizeof (tab);
}
So if I do this it's ok :
char tab[10];
myfunc(tab); // OK because sizeof(tab) = 10
char *tab;
tab = new char [10];
myfunc(tab); // KO because sizeof(tab) = 4 pointer size!!
how can i make the difference between a char* and a char[x]
because I need to do this
void myfun(char * tab)
{
int nTmp;
nTmp = sizeof (tab);
}
So if I do this it's ok :
char tab[10];
myfunc(tab); // OK because sizeof(tab) = 10
char *tab;
tab = new char [10];
myfunc(tab); // KO because sizeof(tab) = 4 pointer size!!