store.c
来自「压缩包里面的都是精致的基本C语言小程序」· C语言 代码 · 共 32 行
C
32 行
#include <stdio.h>#include "../lib/error.h"#include "../lib/hash.h"#include "../lib/nat.h"#include "../lib/mystdlib.h"#include "store.h"struct store{ hash h;};store newStore (){ store st = checkedMalloc (sizeof (*st)); st->h = newHash (); return st;}nat storeLookup (store st, str id){ return hashLookup (st->h, id);} void storeUpdate (store st, str id, nat n){ hashInsert (st->h, id, n);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?