Can somebody help with strings | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

Can somebody help with strings

How do I create 'newEvent' with a new name (115 line). Like I "undo" last Event and putting back but with a new name For example if I wanted to take last Event and make the Row bigger(+10) I would do it like this 115 newEvent = top(&EventStack); 116 pop(&EventStack) ; 117 newEvent.row += 10; 118 push(&EventStack, newEvent) ; 119 print(&EventStack); But how do you do it with a string? https://code.sololearn.com/c98cLKBdf21B/?ref=app

17th Jan 2021, 10:21 AM
zaya1235
zaya1235 - avatar
4 ответов
+ 3
zaya1235 But what is the exact problem? I ran the code with 4 inputs and it worked fine for me. Please explain what is the output you are expecting. And also, Martin Taylor is talking about the `stack` *class* in the C++ standard library *that implements the stack data structure*. He is not talking about the stack data structure itself.
17th Jan 2021, 4:41 PM
XXX
XXX - avatar
+ 1
XXX I've already fixed the error It should change the name of the last element in the stack "Event" - > "Club"
17th Jan 2021, 7:48 PM
zaya1235
zaya1235 - avatar
0
Martin Taylor there's just push/pop/top functions and in main I'm adding 4 events to the stack and then I'm adding 5 more events. Taking out last 2 events And then I wanted to make new Event but with a different name
17th Jan 2021, 4:30 PM
zaya1235
zaya1235 - avatar
0
Martin Taylor and also its not a class It's a structure
17th Jan 2021, 4:32 PM
zaya1235
zaya1235 - avatar