#include #include #include int main() { void *shared_memory; char buffer[100]; int shmid; // Create or access shared memory shmid = shmget((key_t)1222, 1024, 0666); printf("Key of the shared memory is: %d\n", shmid); // Attach the shared memory shared_memory = shmat(shmid, NULL, 0); printf("Process attached at: %p\n", shared_memory); // Read data from shared memory printf("Data read from shared memory is: %s\n", (char *)shared_memory); return 0; }