开发者

C Shared memory database

So this is a homework assignment, and it's kind of a doozy so i'll try to TL;DR it. Basically Im making a Shared memory database with 5 files (load,query,clean,print,change) Load loads the database from a file. (students have a first name/last name/address/telephone number) Query lets someone "search" for a specific student print....well prints the contents of the shared memory and change lets people change the database and clean gets rid of the sephamores and saves the contents of the shared memory to a file.

Now the professor gave us a bunch of code, and for the most part I understand it. His was seperated in 3 files. (a change,create and header file) My main question is, how would I go about storing multiple "objects" into shared memory.

Like he keeps the student data in a struct naturally, and for his "example" he seems to load it by using a struct * ptr. But how would I go about loading multiple students?

I could post the source here, but it's 4开发者_C百科 different files and quite long.


Use an array of structs, instead of a single struct?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜