Hello there
i wanna get the the size of a dynamic array of integer type which i have created like that.........
- int *arr=0;
-
arr = createTempArray();
-
arr = storeRowValues(arr);
-
arr = storeColValues(arr);
-
check(arr);
-
}
-
}
-
}
-
int* createTempArray()
-
{
-
int length = rowIndex+colIndex;
-
int *tempArray = new int[length];
-
return tempArray;
-
}
-
int *storeRowValues(int *tempArr)
-
{
-
for(int i=0;i < colIndex; ++i)
-
{
-
tempArr[i]=array[rowIndex][i];
-
}
-
return tempArr;
-
}
-
int *storeColValues(int *tempArr)
-
{
-
int size = sizeof(tempArr) / sizeof(tempArr[0]);
-
-
for(int i=0; i < size; i++)
-
{ if(tempArr[i]==7)
-
{
-
--i;
-
break;
-
}
-
}
I wanna get the the value of size in
storeColValues(int *tempArr) method ..............
**********code***********
- int size = sizeof(tempArr) / sizeof(tempArr[0]);
this line always gives me a result of 1
somebody please help me and give me some hint or piece of code so that i can find the size correctly........