Hello there
i wanna get the the size of a dynamic array of integer type which i have created like that.........
[CODE=cpp] int *arr=0;
arr = createTempArray ();
arr = storeRowValues( arr);
arr = storeColValues( arr);
check(arr);
}
}
}
int* createTempArray ()
{
int length = rowIndex+colInd ex;
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;
}
}[/CODE]
I wanna get the the value of size in
storeColValues( int *tempArr) method ..............
**********code* **********
[CODE=cpp]int size = sizeof(tempArr) / sizeof(tempArr[0]);[/CODE]
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...... ..
i wanna get the the size of a dynamic array of integer type which i have created like that.........
[CODE=cpp] int *arr=0;
arr = createTempArray ();
arr = storeRowValues( arr);
arr = storeColValues( arr);
check(arr);
}
}
}
int* createTempArray ()
{
int length = rowIndex+colInd ex;
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;
}
}[/CODE]
I wanna get the the value of size in
storeColValues( int *tempArr) method ..............
**********code* **********
[CODE=cpp]int size = sizeof(tempArr) / sizeof(tempArr[0]);[/CODE]
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...... ..
Comment