AnsweredAssumed Answered

Visual DSP Struct error

Question asked by Doriya on Aug 26, 2009
Latest reply on Aug 27, 2009 by Laz



I've been writing code, and I've found that basic struct code gets errors.


Here is my code:

typedef struct{
    float A;
    float U[6];


model_s mm_one;


mmone.A = 0.2;


And here are the errors I get:

".\model_header.h", line 12: cc0077: {D} error: this declaration has no
          storage class or type specifier
  mm_one.A = 0.2;


".\model_header.h", line 12: cc0147:  error: declaration is incompatible with
          "model_s mm_one" (declared at line 10)
  mm_one.A = 0.2;


".\model_header.h", line 12: cc0065:  error: expected a ";"
  mm_one.A = 0.2;


3 errors detected in the compilation of ".\process_data.c".
cc3089: fatal error: Compilation failed
Tool failed with exit/exception code: 1.
Build was unsuccessful.


It seems like the compiler is not recognising that mm_one is of model_s type.


How can I get it to work? I've searched everywhere for struct and typedef struct syntax, and I'm quite sure I'm using the right syntax, so what else could I be doing wrong?