摘要: 一个类,在未定义任何构造函数的情况下,创建该类对应的对象实体时,编译器会隐式的定义一个默认的构造函数--合成的默认构造函数,其按照如下规则初始化类的数据成员: 如果存在类内的初始化值,用它来初始化成员。 否则,默认初始化该成员。 然而,合成的默认构造函数只适合简单的类。对于一个普通的类来说,必须定义 阅读全文
posted @ 2019-06-13 21:32 Lightmonster 阅读(261) 评论(0) 推荐(0) 编辑
摘要: constexpr函数(constexpr function)是指能用于常量表达式的函数。定义constexpr函数的方法与其他函数类似,不过要遵循几项约定:函数的返回类型及所有形参的类型都得是字面值类型,而且函数体中必须有且只有一条return语句: 我们把new_sz定义成无参数的constex 阅读全文
posted @ 2019-06-11 17:46 Lightmonster 阅读(2097) 评论(0) 推荐(0) 编辑
摘要: Buses are typically designed to transfer fixed-sized chunks of bytes known as words. The number of bytes in a word (the word size) is a fundamental sy 阅读全文
posted @ 2019-06-10 22:14 Lightmonster 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 数组无法被拷贝,所以函数无法返回一个数组。但是,函数可以返回数组的指针或引用。下面是返回数组的指针或引用的方式: 其中arrT是含有10个整数的数组的别名、因为我们无法返回数组,所以将返回类型定义成数组的指针。因此,func函数接受一个int实参,返回一个指向包含10个整数的数组的指针。 声明一个返 阅读全文
posted @ 2019-06-09 16:54 Lightmonster 阅读(4233) 评论(0) 推荐(0) 编辑
摘要: As we’ve seen, a pointer is an object that can point to a different object. As a result,we can talk independently about whether a pointer is const and 阅读全文
posted @ 2019-06-05 13:19 Lightmonster 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 在信号传输过程中,整个通信系统对传输信号不同频率有不同的衰减,导致信号失真,无法在接收端恢复原始信号。为了在接收端能得到较好的波形,需要对受损的信号进行补偿,常用的补偿技术有:预加重,去加重以及均衡技术。下面介绍这三种信号补偿技术。 在信号同理中,相对于低频分量,信号的高频分量有很大的衰减。均衡的作 阅读全文
posted @ 2019-06-04 22:53 Lightmonster 阅读(3753) 评论(0) 推荐(1) 编辑
摘要: using namespace std; string decodeString(const string& s, int& i); int main(void) { //3[z]2[2[y]pq4[2[jk]e1[f]]]ef string s = "3[z]2[2[y]pq4[2[jk]e1[f]]]ef"; int i = 0; string out = d... 阅读全文
posted @ 2019-04-10 10:40 Lightmonster 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Q1:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Q2:A numeric sequence o 阅读全文
posted @ 2019-04-04 21:49 Lightmonster 阅读(195) 评论(0) 推荐(0) 编辑
摘要: LeetCode中的一题,虽然结果没问题,但是超时了,下面的操作真的辣眼睛,记录一下犯蠢。 阅读全文
posted @ 2019-03-22 19:11 Lightmonster 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 13-1 13-2 13-3 13-4 阅读全文
posted @ 2019-03-12 22:31 Lightmonster 阅读(237) 评论(0) 推荐(0) 编辑