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> | |
| enum class Operation { Add, Subtract, Multiply, Divide }; | |
| struct Calculator { | |
| Operation op; | |
| Calculator(Operation operation) { op = operation; } | |
| int calculate(int a, int b) { | |
| switch (op) { |
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
| #!/usr/bin/pwsh-preview | |
| # Setting default values for some variables | |
| $configVersion = "" | |
| $preferredCompiler = "" | |
| $cppStandard = "" | |
| $additionalFlags = "" | |
| $currentDir = (Get-Item -Path ".\").FullName | |
| $configPath = "$currentDir/cpp_config.xml" | |
| $PSVersion = "PowerShell " + $PSVersionTable.PSEdition + " version: " + $PSVersionTable.PSVersion |
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> | |
| int main() { | |
| // Optimizes for speed over memory use. | |
| // On modern machines, int_fast16_t will often instead be 32-bit, consuming 4 bytes like | |
| // int_fast32_t. This is actually better for performance. | |
| std::cout << sizeof(int_fast16_t) << '\n'; | |
| std::cout << sizeof(int_fast32_t) << '\n'; | |
| std::cout << sizeof(int_fast64_t) << '\n'; |
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 <string> | |
| void print_to_screen(const char* char_array) { std::cout << char_array << '\n'; } | |
| int main() { | |
| std::string std_str{"Hello, World!\n"}; | |
| const char* char_array{std_str.c_str()}; | |
| print_to_screen(char_array); |
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 <Wire.h> | |
| void setup() | |
| { | |
| Wire.begin(); | |
| Serial.begin(115200); | |
| Serial.println("\nI2C Scanner"); | |
| } | |
| void loop() |
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
| # Path to your oh-my-zsh installation. | |
| export ZSH=/home/vm/.oh-my-zsh | |
| # Set name of the theme to load. Optionally, if you set this to "random" | |
| # it'll load a random theme each time that oh-my-zsh is loaded. | |
| # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | |
| # POWERLEVEL9K_MODE='nerdfont-complete' | |
| # ZSH_THEME="powerlevel9k/powerlevel9k" | |
| ZSH_THEME="robbyrussell" | |
| # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) |
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
| #!/usr/bin/env node | |
| const {node: nodeVersion, v8: v8Version, openssl: sslVersion, unicode: uniVersion} = process.versions; | |
| console.log("Node.js version:", nodeVersion); | |
| console.log("V8 version:", v8Version); | |
| console.log("OpenSSL version:", sslVersion); | |
| console.log("Unicode support:", uniVersion); | |
| // console.log(process.versions); |
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
| using System; | |
| interface IEmployee | |
| { | |
| string Id { get; set; } | |
| string FullName { get; set; } | |
| string Email { get; set; } | |
| string Phone { get; set; } | |
| string Company { get; } | |
| } |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #define bufSize 1024 | |
| int main(int argc, char const *argv[]) | |
| { | |
| FILE *in; | |
| char buf[bufSize]; |
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
| int main() | |
| { | |
| char s[20], r[20]; | |
| int begin, end, count = 0; | |
| printf("Input a string\n"); | |
| scanf("%s", s); | |
| // Calculating string length | |
| while (s[count] != '\0') |