-
-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constant arrays #2129
Comments
It should work if you add |
Strange, but this actually works, except in the case of |
const only works with scalars, very old quirk.On Mar 26, 2024 10:34 AM, Andrey Barkovskiy ***@***.***> wrote:
It's strange, but it really works. Again, not the case with charArray. Why is it not possible to use only the const modifier?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
On Mar 26, 2024 10:34 AM, Andrey Barkovskiy ***@***.***> wrote:
It's strange, but it really works. Again, not the case with charArray. Why is it not possible to use only the const modifier?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
On Mar 26, 2024 10:34 AM, Andrey Barkovskiy ***@***.***> wrote:
It's strange, but it really works. Again, not the case with charArray. Why is it not possible to use only the const modifier?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Yea, I see... static const char test[] = "Candy";
public void OnPluginStart() {
MakeSandy(test);
PrintToServer("[DEBUG] test = '%s'", test);
}
void MakeSandy(const char[] str) {
str[0] = 'S';
} Terminal:
Server console:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Help us help you
Environment
Description
The
const
modifier doesn't work for arraysProblematic Code (or Steps to Reproduce)
File:
constants.sp
Logs
The text was updated successfully, but these errors were encountered: