Skip to content

Error on setting string array index to constant #400

@JoinedSenses

Description

@JoinedSenses

Unable to set multi dimension char array to constant in 1.11.6455

Error produced:
error 022: must be lvalue (non-constant)

#include <sourcemod>

char g_sTest[MAXPLAYERS+1][32];

public void OnPluginStart() {
	g_sTest[1] = "hello"; // error

	char test[2][32];
	test[1] = "test"; // error

	test[1][0] = '\0'; // ok
	g_sTest[1] = test[1]; // ok
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions