Palonez
бб братки
- Сообщения
- 3,035
- Реакции
- 1,837
Как передать в метод строку по ссылке и вернуть измененное значение или изменить значение?
Если с обычными интами или булями ясно, то тут что-то проблемсы
C-подобный:
methodmap Config < KeyValues
{
....
....
public void Name(char &sName)
{
this.Rewind();
this.GetString("Name", sName, sizeof(sName)); //argument type mismatch (arg 2)
}
....
....
....
public char[] Name()
{
char sName[256];
this.Rewind();
this.GetString("Name", sName, sizeof(sName));
return sName;
}
при использовании methodmap.Name со второго варианта кидает такую ошибку
//missing function call, cannot use non-static member function as a value
//A numeric range with the syntax “n1 .. n2”, where n1 and n2 are numeric constants, is invalid. Either one of the values in not a valid number, or n1 is not smaller than n2.
}