#Array of Structures issue

6 messages · Page 1 of 1 (latest)

spice plankBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

ionic marten
#

you pass in the same instance of a string every time

#

event_name always points to the same location

light wolf
#

i didn't know this before either, but it looks like something that will vary between every single execution and on onlinegdb.com it seems like the memory addresses are consistently reused every time https://stackoverflow.com/questions/62432414/c-why-variables-created-in-a-loop-have-the-same-memory-address

#

if you add in some print statements you will see that the event_name inside your while loop has the same address every time, the event_name inside your add_event() function call has the same address every time (but different from the one in the while loop), and the only one that differs is the event_name address in the events array

spice plankBOT
#

This question thread is being automatically marked as solved.