so i have a home work on structs and i made this code , i just cant figure out where i went wrong
the cin isnt filling my array and its giving me a garbage value
The mistake was to pass comp to Read by value, instead of by reference. Now Read writes things to a copy of comp which does not change the original. The solution is to change read to void Read(companyType& comp). Do read something about passing by value and by reference.