Skip to content
Advertisement

I wanted to create a shared memory for student report card data but it returns the error condition in the shmat syscall

I wanted to create a project where the requirement is to use shared memory to create a student report. Asks user for number of students report to be created and dynamically allocate the memory. But when I try to attach it, it gets into the error check if statement and after printing the error message it prints success.

JavaScript

}

Advertisement

Answer

You need to think about what this line is doing:

JavaScript

The right way to do it is:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement