目前分類:C/C++ (7)
- Apr 18 Thu 2019 17:15
How to : const & pointer
- May 16 Wed 2018 16:20
Compile Error
- Jan 25 Thu 2018 09:52
const void * & void *
- Jan 17 Wed 2018 10:31
C/C++ 面試考題整理
- Jan 13 Sat 2018 10:09
[LeetCode] Problem 1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
- Jan 06 Sat 2018 16:09
[LeetCode] Problem 665. Non-decreasing Array
Problem 665: Given an array with n
integers, your task is to check if it could become non-decreasing by modifying at most 1
element.
We define an array is non-decreasing if array[i] <= array[i + 1]
holds for every i
(1 <= i < n).
- Dec 19 Tue 2017 22:01
介紹C語言的function pointer
Function pointers in C
Let's start with a basic function which we will be pointing to:
int addInt(int n, int m) {
return n+m;
}
First thing, let's define a pointer to a function which receives 2 int
s and returns an int
: