structure of arrayのC言語での実装についての質問です。
以下のようにstructure of arrayで構造体要素を動的確保したいのですがうまくできません。
C
1typedef struct soa { 2 int *a; 3 int *b; 4} soa; 5 6int main(){ 7 soa A; 8 9 A->a = (int *)malloc(sizeof(int)*N); 10 A->b = (int *)malloc(sizeof(int)*M); 11}
どのようにすればstructure of arrayで構造体をmallocできるのでしょうか?
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/12/10 07:31
2017/12/10 07:33
2017/12/10 07:55
2017/12/10 08:01
2017/12/10 08:10
2017/12/10 08:14
2017/12/10 08:29