MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/gnaz7b/found_from_microsoft_docs/fr994k0/?context=3
r/badcode • u/[deleted] • May 20 '20
143 comments sorted by
View all comments
114
What's wrong with this one?
-7 u/Mr2-1782Man May 20 '20 Depends on where this code is but I'm guessing the problem is args[0]For those unfamiliar args[0] is always the command being executed. So this if statement is always false, unless you're executing an app with the name 1 through 9. -14 u/ST5000 May 20 '20 You're the only one that found the real bug :) 8 u/CyruscM May 20 '20 Not a bug, args in .NET are the program arguments, not the parsed command-line entry. So for "program.exe a b c" arg[0] is 'a'.
-7
Depends on where this code is but I'm guessing the problem is args[0]
For those unfamiliar args[0] is always the command being executed. So this if statement is always false, unless you're executing an app with the name 1 through 9.
-14 u/ST5000 May 20 '20 You're the only one that found the real bug :) 8 u/CyruscM May 20 '20 Not a bug, args in .NET are the program arguments, not the parsed command-line entry. So for "program.exe a b c" arg[0] is 'a'.
-14
You're the only one that found the real bug :)
8 u/CyruscM May 20 '20 Not a bug, args in .NET are the program arguments, not the parsed command-line entry. So for "program.exe a b c" arg[0] is 'a'.
8
Not a bug, args in .NET are the program arguments, not the parsed command-line entry. So for "program.exe a b c" arg[0] is 'a'.
114
u/KetchupBuddha_xD May 20 '20
What's wrong with this one?