Это функция, которую я использовал для проверки этого, печатается первый оператор printf. правильное значение, а второе нет.
Код: Выделить всё
//used to write text at a given point on the screen
void Scene::NewText(LCD1602 lcd, const char *text, int column, int row){
Button newText = Button(lcd, text, column, row);
printf("%s \n",text);
_textArray[textNum] = newText;
printf("%s \n", _textArray[textNum]._buttonText); //prints newText from _textArray
textNum++;
}
Код: Выделить всё
Button _textArray[100];Код: Выделить всё
char _buttonText[100]; //text displayed by button.Код: Выделить всё
Scene scene1 = Scene(0);Код: Выделить всё
scene1.NewText(lcd, "HELLO", 0, 0);Подробнее здесь: https://stackoverflow.com/questions/781 ... urned-in-c
Мобильная версия