0
StructタグとPointer to Structの違いは何ですか?同じだ?またはここに私の例は、objと* varは2つの異なるメモリの場所ですか?structタグと構造体へのポインタは同じですか?
#include <stdio.h>
#include <stdlib.h>
struct alloc {
char data;
};
int main(int argc, char** argv) {
struct alloc obj;
struct alloc *var = calloc(5,sizeof(struct alloc));
(var -> data) = 'P';
printf("Data:%d",obj.data);
return (EXIT_SUCCESS);
}
[静的メモリ割り当てと動的メモリ割り当ての違い](https://stackoverflow.com/questions/8385322/difference-between-static-memory-allocation-and-dynamic-memory-allocation) –