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.
30 messages · Page 1 of 1 (latest)
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.
334-55-3214;
Also I would appreciate it if you point me in the right direction, rather than giving me the answer outright, because I want to learn to become a better programmer
thats not a valid integer
I see, but thats not the issue
I am just testing my code, and want to fix my salary generator atm, that was just a placeholder value
if (s.department = HR) {
return 20000;
}
bonus points if you use a switch case instead of ifelse
Just curious, why is it return in the function instead of reassigning the salary variable?
well because you assign it here Charles.salary = salaryGenerator(Charles);
Also, that did not seem to work for me, unless I did something wrong
wouldnt make much sense if you assign and change the struct
also youd have to pass it as a pointer
if you dont return
Even when returning my value is 0 though
do you know the difference between = and ==?
Ohhhhh
I was assigning instead of comparing
That went over my head, thank you for that
yea and that assigment just so happened to have a value of 0
because HR is the first identifier in enum
Damn, I didnt even think about why I was getting a 0 in the first place but that totally makes sense
Yep
HR just happens to be the first enumation which is 0
Thank you for your help nekro
I just started programming a few days ago so im very new to it all
!Solved
!solved
[SOLVED] Accessing a struct in a function and reassigning a variable
Accessing a struct in a function and reassigning a variable