Casting Issue

This is for some avr code and I'm not sure if this is a normal error (this is C code). These are all my types.

1
2
3
4
5
6
7
8
9
10
11
12
13
typedef struct
{
    void * Sharedmem;
    bool CheckedOut;
} Mutex;

typedef struct
{
    char * Str;
    int Length;
} String;

((Mutex*)BufferMem)->(String*)SharedMem->Length //additional code here 


What it appears to want is to have

 
->SharedMem


and it can't get around that. The actual error is

 
Expecting Declaration before the (
You need multiple lines to perform the cast.

1
2
String* s = (String*)((Mutex*)BufferMem0>SharedMem);
s->Length;

Topic archived. No new replies allowed.