can anyone explain to me why this is wrong?

i tried cin >> passName however that gave me error as well
17 Replies
the magic guy
the magic guy3y ago
Cuz passName is a constant You can’t modify it
Shiki
Shiki3y ago
^
sesame.seed2
sesame.seed2OP3y ago
Should it be a constant though? This is the instructions from the workshop
sesame.seed2
sesame.seed2OP3y ago
the magic guy
the magic guy3y ago
Why should it be constant?
sesame.seed2
sesame.seed2OP3y ago
no idea even when i took off the const the error went away but it still exits with a long negative number and gives me writing access violation error
sesame.seed2
sesame.seed2OP3y ago
sesame.seed2
sesame.seed2OP3y ago
the issue function was made by my prof
sesame.seed2
sesame.seed2OP3y ago
so ive made progress except the error is now coming from my profs function
sesame.seed2
sesame.seed2OP3y ago
but its storing the string correctly in all my variables i am watching except it is throwing an exception when its trying to copy does anyone have any ideas as to why this is happening
Eakam
Eakam3y ago
I would guess one of them is not initialized or is null at that point
sesame.seed2
sesame.seed2OP3y ago
yes m_name is apparently null i just dont know why its giving me that error
the magic guy
the magic guy3y ago
You are trying to access something that does not exist if m_name is null, there's nothing inside it for you to access
sesame.seed2
sesame.seed2OP3y ago
how would i fix it? m_name is a member of another class
the magic guy
the magic guy3y ago
Set the variable somewhere in another function before this point in your code
sesame.seed2
sesame.seed2OP3y ago
those are the profs functions i cannot modify this module
Eakam
Eakam3y ago
You can modify the value of m_name in another one of your functions, before the prof function is called
Want results from more Discord servers?
Add your server