Hi all,
I’m trying to pass a pointer of a multidimensional struct (Array of struct) to a function.
struct data{
int t1;
int t2;
};
data Data1[10];
void showAll(struct data *ptData)
{
for(int i = 0; i < 10; i++)
{
Serial.println( *((ptData->t1)+i) );
}
}
My problem is, that I don’t know how to “index” the pointer on the struct array.
Do you maybee have a hint for me?
Thank you very much!
Hi gfvalvo,
thank you very much! Your suggestion works in the shown example which I used to simplyfy my question.
I'm sorry, but my actuall project contains multiple files (.cpp and .h) which are also containing a class.
using ptData*.t1 seems to be one step ahead, but the compiler still gives me this error meassages:* invalid use of incomplete type 'struct data' and in file included from class.h note forward declaration of struct data.. Do you have another hint for me? Thank you very much!