corey
corey
CC#
Created by corey on 5/12/2023 in #help
❔ Can you modify fields in a struct?
I am working on a school project and have run into an issue. Code snippets is: https://sourceb.in/SsaOkq7M8I This line, game.quantityInCart++; doesn't actually change the variable. When I print it Console.WriteLine($"{game.quantity} - {game.quantityInCart}"); it is always 0. Can variables in a struct not be modified ?
16 replies