Typedef Struct

Hello, I am tryng to create a new type definition, of struct size.

It seems to work fine, when a create a new single variable, but it fails on the following scenario:

When tryting to declare an array of the new type This is a sample code:

[typedef struct Therm_Profile{
  String Pf_name;
  char PR_ramp;
  int PR_dt;
  char PR_temp;
  int SK_ramp;
  int SK_dt;
  char SK_temp;
  char RF_ramp;
  int RF_dt;
  char RF_temp;
 }Therm_Profile;
void ring_buzzer(Therm_Profile profile);

The struc definition is on a tab called A10_defintions The function is on a different tab called A2_function

The error I get is

'profile' was not declared on this scope.

Thanks in advance for your help.

Best Regards, Adolfo Sanchez

I suspect you are going to have to move the struct to a header file which is then included in both tabs to ensure the compiler touches the struct definition before everything else.

Not sure if that bracket before typedef is a typo but if you want to make an array of structs I think you want something like this:

typedef struct Therm_Profile{
  String Pf_name;
  char PR_ramp;
  int PR_dt;
  char PR_temp;
  int SK_ramp;
  int SK_dt;
  char SK_temp;
  char RF_ramp;
  int RF_dt;
  char RF_temp;
 };

 Therm_Profile tp[10];

Also, in C++ you can drop the 'typedef' when naming structs.