conversion to non-scalar type requested
#include <stdio.h>#include <stdlib.h>
#define PAGE_SIZE 4096
struct client{
int t_value;
};
struct slab{
int ref_count;
void* array;
};
int main(void) {
int amount=PAGE_SIZE/sizeof(struct client);
struct client* cli=malloc(amount*sizeof(struct client));
struct slab* sla=malloc(sizeof(struct slab));
sla->array=cli;
//save a object
struct client* c1=((struct client)(sla->array))[0];
c1->t_value=1;
return EXIT_SUCCESS;
}
红字的地方报错,说conversion to non-scalar type requested,请问是什么问题啊,多谢!