Custom return codes
Typically when a console app exits with no erros, it returns
0 exit code. If there there was an error, it return
But there are many possiblities and developers use this exit code to convey details about what exactly happenned. For example,
When you write a command line application you can return a custom return code.
I added a new method in my Calculator to accept a number as input and exit the application with that number as exit code.
1 2 3 4 5
So now when I call this method from console
dotnet example.dll return, the command ends with an exit code of 5.
Main method's return type should be int for this to work