| 隱式 void* 轉換 | `int *p = malloc(sizeof(int));` | C++ 需顯式轉型 `(int*)malloc(...)` 或改用 `new int` |
| 關鍵字差異 | `class`, `template`, `new`, `delete`, `namespace`, `bool`, `true`, `false` 作變數名 | C++ 保留字,C 可用作標識符 |
| 結構體標籤 | `struct S {int a;}; S s;` | C++ 可直接用 `S s;`,C 需 `struct S s;` 或 `typedef struct S S;` |
| 空參函式 | `void f();` | C 表示參數未指定,C++ 等同 `void f(void)` |
| const 預設連結 | `const int x = 1;` | C 外部連結,C++ 內部連結 (需 `extern const int x = 1;`) |
| 字串字面值類型 | `char *s = "hello";` | C++ 類型為 `const char[N]`,禁止修改,C 類型為 `char[N]` (但修改行為未定義) |
| VLA (變長陣列) | `int n; scanf("%d",&n); int a[n];` | C99 支援,C++ 標準不支援 (GCC/Clang 為擴展支援) |
| 指定初始化器 | `struct {int x,y;} p = {.y=2};` | C99 支援,C++20 才引入 (且語法略異) |
| `restrict` 關鍵字 | `void *memcpy(void *restrict s1, const void *restrict s2, size_t n);` | C99 標準,C++ 無 (編譯器擴展 `__restrict`) |
| 複數類型 | `_Complex double z = 1.0 + 2.0*I;` | C99 ``,C++ 用 `` 模板 |