Hello everyone,

i try to give one function of the softwareproject Im working on right now a array of uint8_t work on that array and then decide in the function what the return value should be and I get the error message like in the caption.

I already tried with a pointer and dont know what I could try next.

int send(linkID_t Link,uint8_t* Date[50]);


void main (void)
{

linkID_t Linkk;

uint8_t  my_variable3[50];

int Back;

Back=send(Linkk,&my_variable3);//Here is the error


int send(linkID_t Link,uint8_t* Date[50])
{

int Back;

//figure out what to do

return Back;

I dont know how I could get my array inside of send(). Sorry if it is a dumb question but it is my first try to do that.

Thanks Rick

thanks for your reply.

I tried what you said but it seems that in my function the array doesnt has it´s dimension anymore. I looked at "Date" in my function with the Debugger and got this

I think that I tried by value and by reference now but I wont get it working. Is there a bulletproof way to give my function the array?

Thanks Rick

In C, arrays passed as parameters are just pointers to the base of the array. The function declaration

send(int array[50])

is the interpreted as

send(int *array)

The size of the array is lost. Within "send()" your code must assume the size of the array is 50. Usually is is passed in as another parameter. That still won't help with your debugger watch. If you really really  really want debugger watch visibility, you might have to put your array in a structure, eg

typedef struct
{
int      n; /*Optional stuff*/
uint8_t* Date[50];
} DateStr;

int send(linkID_t Link,DateSt* Date);


void main (void)
{

linkID_t Linkk;

DateStr my_variable3;

int Back;

my_variable3.n       = 50;
my_variable3.Date[0] = 0;
Back=send(Linkk,&my_variable3);//Here is the error

}

int send(linkID_t Link,DateStr* Date)
{
int Back;
Date->Date[0] = 1;
return Back;
}

There are probably ways to force the debugger watch window to show more than one element.