C
C#7mo 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
AdiZ7mo ago
I will send the code in a second.
AdiZ
AdiZ7mo ago
SinFluxx
SinFluxx7mo ago
Have you tried debugging to see what's happening as it runs?
AdiZ
AdiZ7mo 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
SinFluxx7mo ago
You can put a breakpoint straight away at Encoder encoder = new... and then just step through one line at a time $debug
MODiX
MODiX7mo 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
AdiZ7mo ago
I put a breakpoint there but when I run the program it still just executes everything... I do this:
AdiZ
AdiZ7mo ago
No description
AdiZ
AdiZ7mo 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
SinFluxx7mo ago
Is that definitely the project visual studio is running/the only file in your project?
AdiZ
AdiZ7mo ago
No description
AdiZ
AdiZ7mo ago
Yes. I don't have any other VS windows open.
AdiZ
AdiZ7mo ago
Ah
No description
AdiZ
AdiZ7mo ago
How do I fix that? Ok I figured it out, it was a top-level issue Ok, all working! Thanks for the help.