Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8271587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:53:16+00:00 2026-06-08T06:53:16+00:00

I have a volatile array of type MyType mapped to a shared memory, created

  • 0

I have a volatile array of type MyType mapped to a shared memory, created with CreateFileMapping etc:

volatile MyType *arr;

How do I assign a value to an index of the array? E.g:

MyType a;
arr[n] = a;

I get the compile error:

error C2678: binary ‘=’ : no operator defined which takes a left-hand operand of type ‘volatile MyType’ (or there is no acceptable conversion)

I would like to be able to both be able to assign MyType to volatile and non-volatile arrays.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:53:17+00:00Added an answer on June 8, 2026 at 6:53 am

    You did not mark your assignment operator as volatile. Volatile correctness is identical to const correctness- you have a volatile object but no volatile operator, so the call is ill formed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this cookie in Firefox: name:Vanilla-Volatile value:1-1313808454|54614728ee113ab09e4db5c863cd5cfa|1313635654|1|1313808454 domain:zhu13890.prod.xxxx.corp path:/ Then, I try to
I was wondering how to declare a volatile pointer to two dimensional shared memory
I have a question about the difference between volatile and mutable. I noticed that
Assume that we have the following code: class Program { static volatile bool flag1;
I have read When to use 'volatile' in Java? but I'm still confused. How
I occasionally use a volatile instance variable in cases where I have two threads
I think i have a pretty good idea about the volatile keyword in java,
In C I have a pointer that is declared volatile and initialized null. void*
I have a question concerning volatile keyword I can't seem to find an answer
I have a UDF non-volatile function in VBA, which requires a global variable (callback

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.