im trying to get the sizeof char array variable in a different function where it was initialize however cant get the right sizeof. please see code below
int foo(uint8 *buffer){
cout <<"sizeof: "<< sizeof(buffer) <<endl;
}
int main()
{
uint8 txbuffer[13]={0};
uint8 uibuffer[4] = "abc";
uint8 rxbuffer[4] = "def";
uint8 l[2]="g";
int index = 1;
foo(txbuffer);
cout <<"sizeof after foo(): " <<sizeof(txbuffer) <<endl;
return 0;
}
the output is:
sizeof: 4
sizeof after foo(): 13
desired output is:
sizeof: 13
sizeof after foo(): 13