![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c语言基础
mrhao61
这个作者很懒,什么都没留下…
展开
-
5种 c++ 类(容器) 重载的运算符
1.vector中重载运算符//==重载//stl_vector.htemplate <class T, class Alloc>inline bool operator==(const vector<T, Alloc>& x, const vector<T, Alloc>& y) { return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());}/原创 2020-07-29 08:19:53 · 1863 阅读 · 0 评论 -
c++ string类 简单实现 cin cout
#include <iostream>#include <string.h>using namespace std;namespace haizei {class string {public: string() { length = 0; data = new char[1]; data[0] = '\0'; }; string(const char *s); string(const st原创 2020-07-28 12:07:32 · 532 阅读 · 0 评论 -
某oj selenium 无需界面 提交代码 自动更新cookie免登陆
alias AC='sudo time python3 up_code.py'from selenium import webdriverfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditionsfrom selenium.webdriver.common.by import Byimport timeimport reim.原创 2020-07-22 22:31:10 · 451 阅读 · 0 评论 -
c语 json cJSON安装
git clone https://github.com/DaveGamble/cJSON.gitcd cJSON/mkdir buildcd build/cmake ..makesudo make installsudo vim /etc/ld.so.conf在第二行加上/usr/local/lib保存执行命令/sbin/ldconfig最简单的例子:#include <stdio.h>#include <cjson/cJSON.h>cJS原创 2020-07-05 14:24:07 · 634 阅读 · 0 评论 -
avl树 在线演示 如何操作 建议
https://www.cs.usfca.edu/~galles/visualization/AVLtree.html原创 2020-04-21 21:22:07 · 1792 阅读 · 1 评论 -
在Linux系统中,假设现在有⼀篇英⽂⽂章,基于项⽬要求,你需要计找出⽂章中,出现频次最多的20个单词,请说明思路,及相关命令
tr -sc "[A-Z][a-z]" "[\012*]" < 1.txt | \tr "[A-Z]" "[a-z]" | \sort | uniq -c | \sort -k1 -n -r | \head -20 | nl原创 2020-04-16 09:55:51 · 454 阅读 · 0 评论 -
c语言 实现 poen pclose
#include <stdio.h>#include <unistd.h>#include <string.h>#include <sys/types.h>#include <sys/wait.h>#include <errno.h>#include <stdlib.h>static pid_t ...原创 2020-04-14 19:53:49 · 1037 阅读 · 0 评论 -
第一次实现的简易shell
https://github.com/libohao666/My_Shellhttps://github.com/libohao666/My_Shell原创 2020-04-14 18:28:01 · 133 阅读 · 0 评论 -
c语言 select poll epoll 区别 总结
IO复用 为了解决大量客户端访问的问题,引入IO技术:一个进程可以同事对多个客户请求进行服务,复用一个进程对多个IO进行服务。IO读写的数据多数情况下没准备好,需要通过一个函数监听这些数据状态,一旦有数据可以读写就服务。 select,poll,epoll都是IO多路复用的机制,监视多个描述符,一旦某个描述符就绪,通知程序进行操作。int select(int nfds, fd_set ...原创 2020-04-12 11:10:29 · 1033 阅读 · 0 评论 -
c语言 使用fgets fprintf 替代read write 读写管道 进行进程通信
使用fgets fprintf替代read write读写管道#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <sys/ipc.h>#include <sys/shm.h>#include <sys/types.h>#inclu...原创 2020-04-09 12:43:07 · 537 阅读 · 0 评论 -
c语言 fork pipe 实现popen plcose源码
还有点问题,待解决#include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdlib.h>#include <errno.h>#inclu...原创 2020-04-09 10:21:16 · 553 阅读 · 0 评论 -
c语言 共享内存 pthread_cond init... server client 互斥锁
client#include<sys/shm.h> #include<sys/ipc.h> #include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<signal.h> #include<sys/types.h> ...原创 2020-04-05 20:34:56 · 310 阅读 · 0 评论 -
c语言 进程 共享内存 pthread_mutex 互斥锁 数字累加
#include<sys/ipc.h> #include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<signal.h> #include<sys/types.h> #include<sys/stat.h> #inclu...原创 2020-04-05 17:01:39 · 701 阅读 · 0 评论 -
亲缘进程、非亲缘进程-共享内存与信号
亲缘进程 共享内存与信号#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <sys/ipc.h>#include <sys/types.h>#include <sys/shm.h>#include <signal.h>...原创 2020-04-04 20:56:09 · 624 阅读 · 0 评论 -
c语言 flock 多进程 数字累加
#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <sys/types.h>#include <sys/wait.h>#include <fcntl.h>#include <sys/file.h>char *num_fi...原创 2020-04-04 17:04:20 · 295 阅读 · 0 评论 -
c语言 实现简单的socket聊天 在线名单 文件传输 如图
github地址原创 2020-03-30 11:53:51 · 861 阅读 · 1 评论 -
c语言 socket 多进程 多线程
多进程 server#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h>#include <arpa/inet.h>...原创 2020-03-28 09:10:33 · 831 阅读 · 0 评论 -
google test
https://github.com/google/googletestmkdir projectcd projectunzip googletest-master.zipyum install -y gcc gcc-c++ make automake步骤二、安装wget (已安装则略过此步)yum install -y wget步骤三、获取CMake源码包wget http...原创 2020-01-12 20:20:15 · 330 阅读 · 0 评论 -
bnnmts
Eular001#include<iostream>using namespace std;int is_val(int n ) { if(n % 3 == 0 || n % 5 == 0) return 1; return 0;}int main(){ int sum = 0; for(int i = 1; i <= 1000; i++) { if(...原创 2019-12-15 16:13:15 · 1851 阅读 · 0 评论 -
线段树
线段树是一种二叉树节点i的权值=她的左儿子权值+她的右儿子权值。原创 2019-12-01 15:23:32 · 83 阅读 · 1 评论 -
c语言基础
1.int printf(const char *format,…)format-格式控制字符串。。。可变参数列表返回输出字符的数量2.原创 2019-12-01 15:20:22 · 203 阅读 · 0 评论