C# 关于LoadLibrary的疑问详解
关于 LoadLibrary 的疑问Win32 API 中 LoadLibrary 函数的功能是加载某个库文件(通常是 dll 文件),然后返回 HMODULE 句柄,可以使用两个这个句柄来调用dll中的导出函数,一切似乎...
关于 LoadLibrary 的疑问Win32 API 中 LoadLibrary 函数的功能是加载某个库文件(通常是 dll 文件),然后返回 HMODULE 句柄,可以使用两个这个句柄来调用dll中的导出函数,一切似乎...
[LeetCode] 648.Replace Words 替换单词In English, we have a concept called root, which can be followed by some other words to form another longer word - let...
目录前言1 循环语句的三要素
2 使用不同循环语句实现六种排列组合
2.1 第一种排列(ABC)
2.2 第二种排列(ACB)
2.3 第三种排列(BCA)
2.4 第四种排列(CBA)
2.5 第五种排列(BAC)
2.6 第六...
[LeetCode] 237.Delete Node in a Linked List 删除链表的节点Write a function to delete a node (except the tail) in a singly linked list, given only access to that...
[LeetCode] 186. Reverse Words in a String II 翻转字符串中的单词之二Given an input string , reverse the string word by word. Example:Input:  ["t",...
[LeetCode] 194.Transpose File 转置文件Given a text file file.txt, transpose its content.You may assume that each row has the same number of columns and eac...
[LeetCode] 692.Top K Frequent Words 前K个高频词Given a non-empty list of words, return the k most frequent elements.Your answer should be sorted by fr...
目录传值调用传址调用总结传值调用要想交换两个整数的值,我们可以自定义一个函数,来实现这个过程。具体代码如下:#include <stdio.h>void Swap1(int x, int y){ int z = 0; z =...
[LeetCode] 188.Best Time to Buy and Sell Stock IV 买卖股票的最佳时间之四Say you have an array for which the ith element is the price of a given stock...
目录一、野指针
二、悬空指针
2.1 情况一
2.2 情况二
2.3 情况三
野指针和悬空指针是指针中常见的两个概念,本文结合实例讲解来讲解下。一、野指针
野指针是指尚未初始化的指...
目录前言1. 命名空间
2. using 指令
3. 不连续的命名空间
4. 嵌套的命名空间
5. 命名空间内变量、函数、全局变量的作用域5.1 using namespace first_space;5.2 using names...
[LeetCode] 191.Number of 1 Bits 位1的个数Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hammi...
[LeetCode] 642. Design Search Autocomplete System 设计搜索自动补全系统Design a search autocomplete system for a search engine. Users may input a sentence (at le...
一、概述C++ 标准模板库 STL(Standard Template Library) 一共给我们提供了四种智能指针:auto_ptr、unique_ptr、shared_ptr 和 weak_ptr,其中 auto_ptr 是 C++98 提出的,C++11...
[LeetCode] 347. Top K Frequent Elements 前K个高频元素Given a non-empty array of integers, return the k most frequent elements.Example 1:Input: nums =...
[LeetCode] 207. Course Schedule 课程清单There are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have pr...
[LeetCode] 190. Reverse Bits 颠倒二进制位Reverse bits of a given 32 bits unsigned integer.Example 1:Input: 00000010100101000001111010011100
Output: 001110010111...
[LeetCode] 676.Implement Magic Dictionary 实现神奇字典Implement a magic directory with buildDict, and search methods.For the method buildDic...
[LeetCode] 193.Valid Phone Numbers 验证电话号码Given a text file file.txt that contains list of phone numbers (one per line), write a one liner bash script to p...
[LeetCode] 203.Remove Linked List Elements 移除链表元素Remove all elements from a linked list of integers that have value val.Example
Given: 1 --> 2 --> 6 --> 3...
目录一、为什么要使用智能指针二、auto_ptr三、unique_ptr四、shared_ptr五、weak_ptr六、智能指针的使用陷阱七、总结为什么要学习智能指针?
咳咳,这个问题不是问大家的,是询...
[LeetCode] 198. House Robber 打家劫舍You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the...
目录1. c强制转换与c++强制转换
2. static_cast、dynamic_cast、const_cast、reinterpret_cast
dynamic_cast
const_cast
reinterpret_cast
3. c++强制转换注意事项
1. c强...
引言使用new expression为类的多个实例分配动态内存时,cookie导致内存利用率可能不高,此时我们通过实现类的内存池来降低overhead。从不成熟到巧妙优化的内存池,得益于union的...
[LeetCode] 309.Best Time to Buy and Sell Stock with Cooldown 买股票的最佳时间含冷冻期Say you have an array for which the ith element is the price of a given sto...
目录一个动态数组的例子
throw 用作异常规范
1) 虚函数中的异常规范
2) 异常规范与函数定义和函数声明
请抛弃异常规范,不要再使用它
在《C++异常入门》一节中,我们讲到了 C++...
[LeetCode] 195.Tenth Line 第十行How would you print just the 10th line of a file?For example, assume that file.txt has the following content:Line 1
Line 2
L...
前言给定两个二叉树,想象当你将它们中的一个覆盖到另一个上时,两个二叉树的一些节点便会重叠。你需要将他们合并为一个新的二叉树。合并的规则是如果两个节点重叠,那么将他们的...
目录0. 类型转换的原理1. 初始化和赋值时进行的转换2. 以{}方式初始化时进行的转换(C++11新增)3. 表达式中的转换4. 传递参数时的转换5. 强制类型转换6. 使用auto让编译器自己...
[LeetCode] 208. Implement Trie (Prefix Tree) 实现字典树(前缀树)Implement a trie with insert, search, and startsWith methods.Example:Trie tri...
[LeetCode] 201.Bitwise AND of Numbers Range 数字范围位相与Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this ra...
采用队列实现,BFS,功能:BFS层次遍历打印、按照节点将BFS序列化成一个字符。#include <iostream>#include <string>#include <queue>using namespace std;struct TreeNode{ i...
[LeetCode] 557.Reverse Words in a String III 翻转字符串中的单词之三Given a string, you need to reverse the order of characters in each word within a sentence wh...
list的介绍
list的优点:
list头部、中间插入不再需要挪动数据,O(1)效率高 list插入数据是新增节点,不需要增容
list的缺点:
不支持随机访问,访问某个元素效率O(N...
[LeetCode] 202.Happy Number 快乐数Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting w...
[LeetCode] 192.Word Frequency 单词频率Write a bash script to calculate the frequency of each word in a text file words.txt.For simplicity sake, you may assume:...
[LeetCode] 199.Binary Tree Right Side View 二叉树的右侧视图Given a binary tree, imagine yourself standing on the right side of it, return the values o...
目录捕获异常
发生异常的位置
开发程序是一项“烧脑”的工作,程序员不但要经过长期的知识学习和思维训练,还要做到一丝不苟,注意每一个细节和边界。即使这样,也不能防止程序出错...
本文实例为大家分享了C语言版三子棋游戏的具体代码,供大家参考,具体内容如下一、游戏说明三子棋相信大家都不陌生,小时候经常在纸上画出九宫格就可以直接和小伙伴一起玩,规则就...
[LeetCode] 209. Minimum Size Subarray Sum 最短子数组之和Given an array of n positive integers and a positive integer s, find the minimal length o...
目录什么是指针指针的应用指针 ± 整数指针 + 指针指针 - 指针野指针野指针成因指针和数组指针 ± 和数组的关系二级指针总结什么是指针指针是应该对象,可以直接指向电脑存储...
[LeetCode] 210. Course Schedule II 课程清单之二There are a total of n courses you have to take, labeled from 0 to n-1.Some courses may...
目录背景引入问题分析指针大小参数位置排布解决问题额外的测试总结参考资料背景引入近期在看一本书,叫做《嵌入式C语言自我修养》,写的内容对我帮助很大,是一本好书。在第6章,GN...
目录扫雷游戏1.菜单2.初始化棋盘3.打印棋盘4.布置雷5.排查雷6.整体效果展示7.代码分享7.1 test.c7.2 game.c7.3 game.h总结扫雷游戏今天我们就要设计一款这样的游戏,首先需要...
目录你认为这段代码输出什么?为什么不等于呢?
应该怎么解决?那么怎么判断两个浮点数 f1 和 f2 相等呢。
伪代码可以简化为 >>怎么判断浮点数等于0?
还有一个问题
总结你认为这段...
目录Mutex(互斥锁)什么是互斥量(锁)?条件变量condition_variable:condition_variable的waitstd::shared_mutex原子操作Mutex(互斥锁)什么是互斥量(锁)?这样比喻:单位上有一台打印机(共享...
无锁操作的本质依赖的原子操作,C++11提供了atomic的原子操作支持atomiccompare_exchange_weak / compare_exchange_strong
当前值与期望值相等时,修改当前值为设定值,返回true...
目录一、主要文件二、界面设计三、方块设计四、设计思路设计思路如下:五、总结首先,看下效果图:图1 游戏运行过程下面详细讲解下制作过程。一、主要文件文件包含三个:tetris.cpp...
目录gcc 命令文件头将内核载入内存总结gcc 命令 使用 gcc 编译 c语言
-c 编译、汇编到目标代码,不进行链接,也就是直接生成目标文件
-o 将输出的文件以指定文件名来储...
目录对数器的作用对数器的实现代码
完整代码对数器的作用对数器用于在自己的本地平台验证算法正确性,用于算法调试,无需online judge。好处: 没找到线上测试的online judge,...