摘要:
字符串常量的写法:char *s = "hello world";最好改写成 const char *s = "hello world";因为修改其内容也会出错。函数返回地址的区别:函数返回地址,除了堆地址和字符串常量地址有意义。其他都无意义。#include <stdio.h>const char 阅读全文
摘要:
二分查找的迭代和递归实现:#include <stdio.h>#include <stdlib.h>int find1(int *a, int low , int high , int key)//迭代二分查找{ int mid = 0; while (low <= high) { mid = (l 阅读全文
摘要:
单向链表的实现方法:#include <stdio.h>#include <stdlib.h>struct list{ int data; struct list *next;};/*创建一个节点*/struct list *create_list(){ return calloc(sizeof(s 阅读全文
摘要:
QT实现的加法运算:void Widget::on_pushButton_clicked(){ QString s1 = ui->lineEdit->text(); QString s2 = ui->lineEdit_2->text(); int sum = s1.toInt(0,10) + s2. 阅读全文