I'm getting the above error in Visual Studio 2019. I'm posting a link to two screen shots so you can see what I'm talking about. I'm happy to post code as soon as I find out what you guys need.
if you were going to use it, working with string literals directly is annoying. it is a lot easier to do this:
const int smallest_allowed_size{20}; //whatever size
char mt[smallest_allowed_size] = "";
foo(mt); //this works, you pass in a char*, not a const char* now
is there a reason you want to use C strings?
This game was written 10 years ago. I'm dusting it off to play it again and make it better. I'm also dusting off my rudimentary C++ knowledge so this is a learning project of sorts. Strangely, I gave this a go about 5 years ago and had it up and running in VS 2017.
salem c:
I made the change you suggested but the build still failed. If you weren't going to use a second parameter anyway why even include it in the definition to begin with? Why was it written this way?
jonnin:
My main goal with this project it so make this code better. I'll try to figure out a way to incorporate the changes you have suggested.
older compilers tolerated what you were doing, using char* off string literals, but stricter rules prevent it now. its probably possible to lower the compilers complaints to take it, if you have too many to fix.
if your goal is to fix it up nice, then moving to c++ <string> is the way to go. It solves a great many problems, but may be too much to take on.
Thomas1965
I'm sure there has to be a way to compile this in VS 2019. It is, afterall, a C++ program that has compiled on previous versions of VS. It may be a matter of settings or changing the code but I'm confident it can be done.
Here's my email. Reach out and I'll send you, or anyone else that's interested, the source code