编程笔记

  • 关于 c:Tab 完成和部分完成

    Tab Completion and Partial Completion 我想做一个程序,它以类似于 Linux 上的 ip 的方式接受命令。例如,我想要一个完整的 show interface options 命令,但用户可以只输入 show in options 甚至只输入 s i o 如…

    编程笔记 2022年6月21日
  • 关于c:打印一个char的十进制值

    Print decimal value of a char 打印字符十进制值的程序: 123456789 #include<stdio.h> int main(void){   char ch = 'AB';  printf("ch is %d/",ch); }为什…

    编程笔记 2022年6月21日
  • 澄清 C 中指针的左值、右值行为

    Clarification over lvalue , rvalue behaviour of pointers in C 1234567891011121314151617 #include<stdio.h> int main(){    int i = 10;    int *p = &i;   …

    编程笔记 2022年6月21日
  • 关于 c:POSIX 计时器在运行几次后挂断

    POSIX timer hangs up after a few runs 我在程序的主函数中创建了一个 POSIX 计时器。主程序的每个线程都在设置计时器,以便在它到期时,信号处理程序更新一个变量,该变量唤醒同一进程的下一个线程。 计时器大部…

    编程笔记 2022年6月21日
  • 关于struct:C 带结构的双向链表

    C Doubly linked list with structure 我正在做一个双向链表。据我所知,它正在工作,但来到这里是为了确保并查看我是否以正确的方式进行操作。 另一方面,当我做这个时,我遇到了其他与双向链表无关的问题,但与 C…

    编程笔记 2022年6月21日
  • 关于 c:linux clone() 返回 -1 作为 child_pid

    linux clone() returning -1 as child_pid 我有以下程序: 1234567891011121314151617181920212223 #define _GNU_SOURCE #include<sched.h> #include<stdio.h> #include<stdlib.h> #include<s…

    编程笔记 2022年6月21日
  • 关于 c:STM32 Cortex-M4F FPU 在基本 VLDR 上的硬故障

    STM32 Cortex-M4F FPU hardfaults on basic VLDR 是的,我的特定 MCU 中有一个 FPU。 代码使用 -mfloat-abi=soft 标志编译,否则浮点变量永远不会传递给 R0 FPU 通过 SCB->CPACR |= ((3UL << (10 * 2)) | …

    编程笔记 2022年6月21日
  • 关于 c:如何使用 gtk 信号将多个变量作为数据传递

    How do I pass multiple variables as data with gtk signals 我有一个小程序,其中 gtk 信号回调函数需要 2 或 3 个变量。 我不想制作这些全局变量(项目的整个目标是整洁),我不想制作一个完整的结构,这样我就可…

    编程笔记 2022年6月21日
  • React Hooks 手写防抖useDebounce

    定义 import { useCallback, useEffect, useRef } from "react" export interface DebounceRefType { fn: Function, timer?: NodeJS.Timeout } export type DebouncePropsType = [Function, number, Array<any&g…

    编程笔记 2022年6月21日
  • React Hooks 手写节流useThrottle

    定义 import { useCallback, useEffect, useRef } from "react" export interface ThrottleRefType { fn: Function, timer?: NodeJS.Timeout } export type ThrottlePropsType = [Function, number, Array<any&g…

    编程笔记 2022年6月21日