-1

I've been coding a dll and it is almost finished, the final issue I have is this. Argument list consists of: (const char [23], const char [23], const char [21], const char [24], const char [24], const char [24], const char [24], const char [17], const char [42]) The above error displayed at this place in my code...

   std::vector<char*> monitors = { //messages to look out for.  Might as well grab everything fairfight related
    "XiteNetworkGet1Message",
    "XiteNetworkGet2Message",
    "XiteNetworkGoMessage",
    "XiteNetworkInfo1Message",
    "XiteNetworkInfo2Message",
    "XiteNetworkInfo3Message",
    "XiteNetworkInfo4Message",
    "XiteNetworkPush1",
    "ScreenshotNetworkRequestScreenshotMessage"
};
1201ProgramAlarm
  • 32,384
  • 7
  • 42
  • 56

1 Answers1

1

String literals are not modifiable, and therefore cannot be stored as char*. You can use const char* instead:

std::vector<const char*> monitors = { ... };

Or, as pointed out in the comments section, you could consider std::vector<std::string>. That would be preferable if there is no special need to store these literals as pointers. Usually there is no such need.

paddy
  • 60,864
  • 6
  • 61
  • 103