motely36
(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?
|
motely36
(1000+ posts)
Send PM |
Profile |
Ignore
|
Sun Dec-19-04 12:01 PM
Response to Original message |
Commie Pinko Dirtbag
(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; }
|
motely36
(1000+ posts)
Send PM |
Profile |
Ignore
|
Sun Dec-19-04 12:37 PM
Response to Reply #2 |
DU
AdBot (1000+ posts) |
Fri Apr 26th 2024, 06:50 AM
Response to Original message |