目前分類:Programming (11)

瀏覽方式: 標題列表 簡短摘要

const 最淺顯直白的意思就是: 只讀

如果要搞清楚定義, 先回答下面的聲明

文章標籤

紅線 發表在 痞客邦 留言(0) 人氣()

https://stackoverflow.com/questions/79923/what-and-where-are-the-stack-and-heap

The stack is the memory set aside as scratch space for a thread of execution. When a function is called, a block is reserved on the top of the stack for local variables and some bookkeeping data. When that function returns, the block becomes unused and can be used the next time a function is called. The stack is always reserved in a LIFO (last in first out) order; the most recently reserved block is always the next block to be freed. This makes it really simple to keep track of the stack; freeing a block from the stack is nothing more than adjusting one pointer.

文章標籤

紅線 發表在 痞客邦 留言(0) 人氣()

在專案K2 VIM中, 有分出一個middleware 為 sys_console

專門用來印debug message, 裡面會定義使用哪一個UART port(使用BSP UART)

用來替代一般程式內的printf

 

文章標籤

紅線 發表在 痞客邦 留言(0) 人氣()

我定義了一個變數 uint8 TASK_MGR_NUM_PERIODIC_TASKS;

這個變數是從別的function extern出來的, 且是程式開始跑後才計算出來的

文章標籤

紅線 發表在 痞客邦 留言(0) 人氣()

1. Declaration may not appear after executable statement in block

根據 ANSI C C90 standard 宣告變數的地方需要在執行任何code 之前

紅線 發表在 痞客邦 留言(0) 人氣()

callback,字面上的解釋就是「回呼」,這牽涉到多工作業系統中兩個同時執行﹝cocurrent﹞的不同模組。一種情形是,A 模組給 B 模組一個 function pointer,

請它在處理完某項工作後,或是在適當時機,使用這個 function pointer 來呼叫該函式。例如,A 模組裡面寫了一個 CallMeIfDone 的 function,然後它啟動了

文章標籤

紅線 發表在 痞客邦 留言(0) 人氣()

 

Tutorial 

文章標籤

紅線 發表在 痞客邦 留言(0) 人氣()

http://ivan7645.github.io/2016/07/12/vim_to_si/

CSCOPE 使用

文章標籤

紅線 發表在 痞客邦 留言(0) 人氣()

發現一個非常多練習程式演算法的題庫 LeetCode

其實是看到先前提到的網誌的作者 OpenGate 大大提到的

紅線 發表在 痞客邦 留言(0) 人氣()

1. C中為何使用 volatile? 他的意義是甚麼?

Reference 和 pointer之間有甚麼關係?

文章標籤

紅線 發表在 痞客邦 留言(0) 人氣()

#include <iostream>

int main(int argc, char **argv)
{
    std::cout << 25u - 50;
    return 0;
}

其結果是  4294967271,  即 2^32-1-24

原因是25 unsigned number -50 結果也是一個unsigned number 

文章標籤

紅線 發表在 痞客邦 留言(0) 人氣()