Ordinary fairy's learning record of pointer (from introduction to learning waste) -- Chapter 12
preface
The following is the explanation of the pointer from the definition, focusing on practice, with exquisite bushi small pictures. If you also find the pointer difficult, learn it with SThree~~
My skills are not high, so the explanation is very easy to understand~~
If you have any doubts or I am wrong, you are welcome to point out!!!
...
Posted by xtheonex on Tue, 23 Nov 2021 06:40:30 -0800
Greedy algorithm C++ puzzle (leetcode101 (biscuit allocation 455 (candy allocation 135) (interval problem 435)
Basic Ideas: Local Optimal - >Global Optimal Difficulty: Determine the best "what object"
Simple questions:
Find money: a total of x Yuan with a minimum of several pieces of money 100 yuan 50 yuan 10 yuan 5 yuan 1 yuan Idea: x divides 100, 50, 20, 10, 5, 1 Integer division adds up
leetcode
455 Allocate cookies
Suppose you're a ...
Posted by amreiff on Sun, 21 Nov 2021 10:53:40 -0800
LeetCode 18. Sum of four numbers
LeetCode 18. Sum of four numbers
Title:
Give you an array of n integers, nums, and a target value, target. Please find and return the quads [nums[a], nums[b], nums[c], nums[d]]:
0 <= a, b, c, d < na. b, c and d are different from each othernums[a] + nums[b] + nums[c] + nums[d] == target
You can return answers in any order.
Example:
...
Posted by thetick on Fri, 22 Oct 2021 13:08:45 -0700
C pointer special exercise
This chapter mainly explains 13 classic exercises about pointers.
Meaning of array name
First, review the knowledge about array names:
1. Sizeof (array name): here, the array name represents the whole array; 2. & array name: here, the array name represents the whole array; 3. In other cases, the array name represents the address of t ...
Posted by rocketsprocket on Mon, 13 Sep 2021 20:13:59 -0700
Understanding of pointers
1: Wrong use is not self-knowledge 2: Wrong export 3: Error resolution 4: Understanding and perception after solution
1: I believe everyone has heard of it, and I know it, and I also know the harm. But I don't know what I've been using is a wild pointer. I'm ashamed to say.
Use pointer before
//Function: read the contents in the pointer ...
Posted by hayson1991 on Fri, 10 Sep 2021 01:12:18 -0700
[C + +] smart pointer
1. Why do I need a smart pointer?
when using pointers, we generally need to apply for a piece of memory space from the memory for use, but if we forget to release the block space, it will cause memory leakage. and if the program has exception handling and throws an exception when applying for memory usage time, th ...
Posted by korporaal on Thu, 02 Sep 2021 15:55:42 -0700