跳到文章

本 日 公 休

Hi, this is Mendax. I’m documenting my learning notes in this blog.

摘要: /* 动态创建一个链表:动态内存申请+模块化设计 1、创建链表 headNode指针 2、创建结点 3、插入节点 4、删除节点 5、打印遍历链表(测试) */ #include <stdio.h> #include <stdlib.h> struct Node{ int data; //数据域 st 阅读全文
posted @ 2020-03-12 23:43 叁壹壹 阅读(396) 评论(0) 推荐(0)
摘要: 以十进制为中介 一、十进制转化为其他进制 1.System.out.println(Integer.toBinaryString(integer));// 十进制转二进制 2.System.out.println(Integer.toOctalString(integer));// 十进制转八进制 阅读全文
posted @ 2020-03-12 18:37 叁壹壹 阅读(159) 评论(0) 推荐(0)
摘要: Char——>String 1. String s = String.valueOf('c'); //单个字符 2. String s = String.valueOf(new char[]{'c'}); //转换数组 3. String s = Character.toString('c');// 阅读全文
posted @ 2020-03-12 18:22 叁壹壹 阅读(844) 评论(0) 推荐(0)
摘要: 32位编译器:char short int long float double 指针 1 2 4 4 4 8 4 64位编译器:char short int long float double 指针 1 2 4 8 4 8 8 所以辨别编译器是几位的可以通过sizeof(long)来判断 阅读全文
posted @ 2020-03-09 14:51 叁壹壹 阅读(337) 评论(0) 推荐(0)
摘要: C++ 中new 有三种用法,分别是:plain new, nothrow new, placement new。 plain new 1 void* operator new(std::size_t) throw(std::bad_alloc); 2 void operator delete( v 阅读全文
posted @ 2020-03-09 10:06 叁壹壹 阅读(2079) 评论(0) 推荐(0)
摘要: /*某种排序*/ #define Size 100 #include<iostream> #include<algorithm> using namespace std; int a[Size]; int Find(int l,int r){ if(r==l) return l; else{ int 阅读全文
posted @ 2020-03-02 16:55 叁壹壹 阅读(153) 评论(0) 推荐(0)
摘要: /*快速排序*/ #include<iostream> #include<stdlib.h> #include<algorithm> using namespace std; const int Max=1e4+5; int array[Max]; int Findout(int l,int r){ 阅读全文
posted @ 2020-03-02 15:45 叁壹壹 阅读(147) 评论(0) 推荐(0)