Hi,
I have a little question.
I have this code.
int *MyFunc()
{
int *ret;
ret = (int*) malloc(a*sizeof(int)); /*here was allocated some bytes*/
/* do something with ret*/
return ret;
}
main()
{
int *r;
r = MyFunc();
printf("My r have %d bytes", ????? );
for(i=0; i< ????; i++)
if( r[i] == 20 )
/*do something*/
}
How can i discover what is the size of my pointer 'r'? How much can my 'i' be increased?
thank's
I have a little question.
I have this code.
int *MyFunc()
{
int *ret;
ret = (int*) malloc(a*sizeof(int)); /*here was allocated some bytes*/
/* do something with ret*/
return ret;
}
main()
{
int *r;
r = MyFunc();
printf("My r have %d bytes", ????? );
for(i=0; i< ????; i++)
if( r[i] == 20 )
/*do something*/
}
How can i discover what is the size of my pointer 'r'? How much can my 'i' be increased?
thank's
