restock2009
restock2009
CC#
Created by restock2009 on 1/5/2025 in #help
Weird bug
In my current code-project happened something that I really dont understand. When I ran the Code the first time, the process went a certain way. However, when I added some "Console.WriteLine()" for guidance, this process changed and the result was diferent, eventhough no variables or logic were changed. Why does this happen? I'm clueless. (Sorry if the explanation was a but confusing, english isnt my first language)
4 replies
CC#
Created by restock2009 on 1/1/2025 in #help
Small Lists issue
im trying to check if a list remained the same after a prozess: ''' List<string> startList=previousList; previousList.Add("item"); Console.Writeline(startList==previousList); ''' This, according to me, should output false since the list was changed. However for some reason the "startList" is also changed simultaniously with the "previousList", eventhough I didn't use ".Add()" with "startList". Why does this happen and how can I fix it?
4 replies
CC#
Created by restock2009 on 11/4/2024 in #help
Constructors, Classes
I have been learning about classes, and when trying constructors in VS Code it gives my an error, eventhough i wrote it exactly like in the course im taking. class Dog(){ float age; private Dog(){ Console.WriteLine("Guau"); age=42; } }
6 replies