can anyone explain to me why this is wrong?
i tried cin >> passName however that gave me error as well

17 Replies
Cuz passName is a constant
You can’t modify it
^
Should it be a constant though?
This is the instructions from the workshop

Why should it be constant?
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


the issue function was made by my prof
so ive made progress except the error is now coming from my profs function

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
I would guess one of them is not initialized or is null at that point
yes m_name is apparently null
i just dont know why its giving me that error
You are trying to access something that does not exist
if
m_name
is null, there's nothing inside it for you to accesshow would i fix it? m_name is a member of another class
Set the variable somewhere
in another function before this point in your code
those are the profs functions i cannot modify this module
You can modify the value of m_name in another one of your functions, before the prof function is called