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
| cc = "clang++" | |
| deps = $(shell find ./ -name "*.h") | |
| src = $(shell find ./ -name "*.cpp") | |
| obj = $(src:%.cpp=%.o) | |
| out = "main" | |
| $(out) : $(obj) | |
| $(cc) -std=c++2a $(obj) -o $(out) | |
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 <cstdio> | |
| void test_dynamic_alloc_ptr_and_arr_ptr() { | |
| int* int_ptr = new int(10); | |
| printf("the int_ptr is: %p\t the value is: %d\n", int_ptr, *int_ptr); | |
| int* int_ptr_arr = new int[2]; | |
| int_ptr_arr[0] = 1; | |
| int_ptr_arr[1] = 2; | |
| printf("the int ptr arr is: %p\t the value is: %d\n", int_ptr_arr, *int_ptr_arr); | |
| // 手动删除 |
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 ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| ) | |
| const resp = ` | |
| Hello, world |
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 ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| ) | |
| const resp = ` | |
| Hello, world |
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
| open System.Collections.Generic | |
| open Microsoft.FSharp.Collections | |
| [<RequireQualifiedAccess>] | |
| module Folds = | |
| // These are the fast implementations we actually want to use |