牛客网 1.链表部分 2.位运算部分
Read more →
一、Nodejs模块引入方式 Node中,每个文件模块都是一个对象,它的定义如下:
function Module(id, parent) { this.id = id; this.exports = {}; this.
Read more →
一、基本程序 #include <iostream>#include <thread>using namespace std; static const int threads = 10; void * co(void* args) { cout<<"test"<<endl; } int main() { pthread_t th[threads]; for(int i=0;i<threads;i++) { int res = pthread_create(&th[i],nullptr,co,nullptr); if(res !
Read more →
一、虚函数的定义 虚函数是为了允许用基类的指针来调用子类的这个函数
二、简单实现 class Next :public Base { void show() { cout<<"Next show"<<endl; } }; class That :public Base { void show() override { cout<<"That show"<<endl; } }; class Same :public Base { virtual void show() { cout<<"That show"<<endl; } }; int main() { Base *be = new Next; be->show(); return 0; } 这就实现了Base调用Next类的函数了。
Read more →
一、Hello World package main import "fmt" func main() { fmt.Println("Hello, World!
Read more →