This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| constexpr long long factorial(int n) | |
| { | |
| long long result = 1; | |
| for (int i = 1; i <= n; ++i) { | |
| result *= i; | |
| } | |
| return result; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| constexpr long long factorial(long long n) | |
| { | |
| if (n == 0) | |
| return 1; | |
| else | |
| return n * factorial(n - 1); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| constexpr long long factorial(long long n) | |
| { | |
| return (n == 0) ? 1 : n * factorial(n - 1); | |
| } | |
| int main() | |
| { | |
| char test[factorial(3)]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <type_traits> | |
| template<long long n> | |
| struct factorial : | |
| std::integral_constant<long long, n * factorial<n - 1>::value> {}; | |
| template<> | |
| struct factorial<0> : | |
| std::integral_constant<long long, 1> {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| template<unsigned int n> | |
| struct factorial | |
| { | |
| enum | |
| { | |
| value = n * factorial<n - 1>::value | |
| }; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "archive/zip" | |
| "fmt" | |
| "io" | |
| "log" | |
| "os" | |
| "path/filepath" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Source code examples: | |
| * https://grep.app/search?q=IApplicationAssociationRegistration&filter[lang][0]=C%2B%2B | |
| * https://github.com/QupZilla/qupzilla/blob/master/src/lib/other/registerqappassociation.cpp | |
| * https://github.com/mpc-hc/mpc-hc/blob/master/src/mpc-hc/FileAssoc.cpp | |
| * https://github.com/syndicodefront/infekt/blob/master/src/win32/default_app_win7.cpp | |
| * https://github.com/syndicodefront/infekt/blob/master/src/win32/default_app_win8.cpp | |
| In gecko-dev source code: | |
| * Telemetry.cpp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| // https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "io" | |
| "log" | |
| "os" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| // https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html | |
| import ( | |
| "fmt" | |
| "os/exec" | |
| ) | |
| func checkExeExists(exe string) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| // https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "os/exec" | |
| ) |