• /r/csharp
  • Starting out with C#

    Hi all, I’m very much a beginner to C# and programming in general. I’ve taken Microsoft’s free C# for beginners course online, and decided to create my first function from scratch; to calculate my energy bill in my flat. I’ve got it working, but I feel I’ve structured the file in an inefficient way and […]

  • /r/csharp
  • Whats in the array before declaring?

    How does declaring an array char[] charArray = ; without setting anything to equal purpose: to see the fill in the array, get the empty value before changing it like so: string in = Console.ReadLine(); char[] charArray =in.ToCharArray(); current theory: char[] charArray = ; for (int spike = 0; spike < charArray.Length; spike++) Console.Write(spike); before […]

  • /r/csharp
  • New to programming and getting error message in Visualstudio I am unsure about

    string strInputPath = “ModelsInput2.txt”; string strOutputPath = “Models.txt”; using (StreamReader sr = new StreamReader(strInputPath)) using (StreamWriter sw = new StreamWriter(strOutputPath)) i have these 4 lines of code to read a file and create a new one. the last two lines are getting errors Visual studio is telling me cannot convert from string to system.io.stream this […]