
C/C++ 基础
秋叶编程
这个作者很懒,什么都没留下…
展开
-
arrays.h contains only function declarations (AKA prototypes)
【代码】arrays.h contains only function declarations (AKA prototypes)原创 2024-11-19 09:49:04 · 77 阅读 · 0 评论 -
arrays.h contains only function declarations (AKA prototypes)
【代码】arrays.h contains only function declarations (AKA prototypes)原创 2024-11-19 09:48:07 · 800 阅读 · 0 评论 -
arrays.h contains only function declarations (AKA prototypes)
【代码】arrays.h contains only function declarations (AKA prototypes)原创 2024-11-18 14:32:33 · 121 阅读 · 0 评论 -
Assignement5: Multi-threaded Producer Consumer Pipeline
Assignment 5: Multi-threaded Producer Consumer Pipeline原创 2024-06-04 09:11:34 · 217 阅读 · 0 评论 -
makefile 模板
.PHONY : all clean rebuildMKDIR := mkdirRM := rm -frCC := gccDIR_DEPS := depsDIR_EXES := exesDIR_OBJS := objsDIRS := $(DIR_DEPS) $(DIR_EXES) $(DIR_OBJS)EXE := app.outEXE := $(addprefix ...原创 2020-03-29 22:34:45 · 162 阅读 · 0 评论 -
一段简单高效的冒泡排序代码
这段代码思路是一个朋友在群里分享的,我简单看了下,发现思路真的很好。下面是我的简化版,先给贴出代码。void bubble_sort(vector<int> &vec){ int i = 0; while (i < vec.size() - 1) { if (vec[i] > vec[i + 1]) { ...原创 2020-02-15 13:24:00 · 617 阅读 · 0 评论 -
类中或结构体中含队列,的拷贝构造函数的书写
Node::Node(){ }Node& Node::operator=(const Node&ths){ this->_q = ths._q; return *this;}//void Node::Destroy()//{////}Node::~Node(){ std::cout<<"my destro...原创 2015-12-03 11:11:51 · 1144 阅读 · 0 评论 -
关于头文件变量的声明和定义
先说说结论吧!在很多论坛和问问中看到这样的问题: 在头文件是否可以定义变量?今天写了一堆文件进行了验证。结论:1.在头文件中可以定义变量,但我们一般不这样做,在C语言中,变量只能定义一次,而头文件经常被多个文件包含, 这样的结果就是,变量被多次定义。 2.在头文件中 int var; 相当于extern int var;原创 2013-08-04 11:07:32 · 1130 阅读 · 0 评论 -
安装ubuntu后的配置和软件安装,留给自己以后用
1. 几乎每次装好ubuntu之后,vim都不能正常使用。 sudo apt-get install vim 就好。2.qq, google浏览器 先下载deb包。然后: dpkg -i *.deb 3.安装flash控件 先现在和系统相关的包,然后解压,再把解压后的usr文件复制到根目录的/usr下 tar -xvf **.deb原创 2013-07-27 09:17:16 · 655 阅读 · 0 评论 -
C++程序员我的学习指南
1、熟悉Windows(或者Linux)下的socket编程及多线程编程; 2、了解TCPIP、HTTP等协议; 3、数据SQL,熟悉至少一种常用DBMS,如Oracle,MySQL;拥有优秀的数据设计能力; 4、熟悉软件工程方法,具备良好的文档编制习惯和代码书写规范; 5、具有即时通讯开发经验,熟悉TCP,UDP,XMPP,SIP等IM相关协议及编程者优先; 6、熟悉常用设计原创 2013-06-18 21:50:12 · 678 阅读 · 0 评论 -
遇到的一些笔试题
void print5(){ int n[]={1,3,5,7,9}; int *p=n; int m,i,j; m=*(p+1)*(p+1)[1]; i=*p++; j=*p; printf("%d %d %d\n",m,i,j);}原创 2013-05-14 22:57:27 · 608 阅读 · 0 评论 -
打印int值的位表示形式
void bit_print(int a){ int n = sizeof(int)*CHAR_BIT; int i; int mask = 1<<(n-1); for (i=1; i<=n; ++i) { putchar(((a&mask)==0)?'0':'1'); a <<= 1; if (i%CHAR_BIT==0 && i<n) putchar(' ');原创 2013-05-11 20:19:13 · 751 阅读 · 0 评论