Hi guys.
While I'm trying to compile my code, I get a error.
Thank you for helping.
Hi guys.
While I'm trying to compile my code, I get a error.
Thank you for helping.
You forgot to specify the type the array elements, e.g.,
notice the int. In your case it would be a const char*Code:int xs[10] = {0, 1, 2};
EDIT:
Wait, I notice that you have a parameter with the same name. Are you trying to assign to the parameter? If so, this won't work because you cannot assign to an array (but you can initialise an array and can assign to its elements, if they aren't also arrays), and you're trying to use initialisation syntax for assignment.
I would suggest that either you ditch the parameter, or you initialise the array in the place where you define it (e.g., the caller), or you assign to the individual pointer elements (but note that to avoid mistakes they should be const char* rather than just char* as string constants cannot be modified).
Last edited by laserlight; 03-25-2019 at 04:26 AM.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)