Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Help!!!! Unix Shared Memory Question.

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
motely36 Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Dec-19-04 11:46 AM
Original message
Help!!!! Unix Shared Memory Question.
I know this is an odd place to ask, but I'm not getting any help at any computer forums, so I thought I'd try here.

I created a shared memroy segment using shmget() and then attached it to a pointer using shmat(). Now I want to put a boolean array into the shared memory. I thought I could do this by saying:

bool *isEmpty<5>=(bool*)(shmptr);

but the compiler gives me an error "invalid initializer" .

Any suggestions?
Printer Friendly | Permalink |  | Top
motely36 Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Dec-19-04 12:01 PM
Response to Original message
1. Anyone at all?
:shrug:
Printer Friendly | Permalink |  | Top
 
Commie Pinko Dirtbag Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Dec-19-04 12:27 PM
Response to Original message
2. Lose the [5] at the initialization
bool *isEmpty=(bool*)(shmptr);

for (i = 0; i < 4; i++)
{
isEmpty<i> = whatever;
}
Printer Friendly | Permalink |  | Top
 
motely36 Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Dec-19-04 12:37 PM
Response to Reply #2
3. Thanks
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Fri Apr 26th 2024, 06:50 AM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC