C
C#13mo ago
AdiZ

✅ Caesar Cipher Code Not Returning Anything

This is my code. I'm not understanding why, when I build this, nothing is outputted to the Console. Can anyone help?
14 Replies
AdiZ
AdiZOP13mo ago
I will send the code in a second.
AdiZ
AdiZOP13mo ago
SinFluxx
SinFluxx13mo ago
Have you tried debugging to see what's happening as it runs?
AdiZ
AdiZOP13mo ago
I'm not really sure where I should put things Just everywhere? I've not had any experience debugging so it's not natural to me where I should do it In the code
SinFluxx
SinFluxx13mo ago
You can put a breakpoint straight away at Encoder encoder = new... and then just step through one line at a time $debug
MODiX
MODiX13mo ago
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
AdiZ
AdiZOP13mo ago
I put a breakpoint there but when I run the program it still just executes everything... I do this:
AdiZ
AdiZOP13mo ago
No description
AdiZ
AdiZOP13mo ago
Then I hit F5. Then the entire thing runs and then finishes. It doesn't pause at line 7
static void Main()
{
Encoders encoder = new Encoders();
ListConstants listConstants = new ListConstants();
encoder.Start();
listConstants.Start();
Console.WriteLine("Wow");
Console.WriteLine(encoder.ShiftCaesarCipher("Hi", 1));
}
static void Main()
{
Encoders encoder = new Encoders();
ListConstants listConstants = new ListConstants();
encoder.Start();
listConstants.Start();
Console.WriteLine("Wow");
Console.WriteLine(encoder.ShiftCaesarCipher("Hi", 1));
}
Changing it to this and still nothing gets called I just realized that the program isn't running Main() @SinFluxx Did I structure it properly there?
SinFluxx
SinFluxx13mo ago
Is that definitely the project visual studio is running/the only file in your project?
AdiZ
AdiZOP13mo ago
No description
AdiZ
AdiZOP13mo ago
Yes. I don't have any other VS windows open.
AdiZ
AdiZOP13mo ago
Ah
No description
AdiZ
AdiZOP13mo ago
How do I fix that? Ok I figured it out, it was a top-level issue Ok, all working! Thanks for the help.
Want results from more Discord servers?
Add your server