acl4の開発ログ #04

2026.01.25(日) #0

2026.01.28(水) #0

2026.01.28(水) #1

class_(Elm) { int i; char *s; };

VecChr stk[1]; VecChr_ini(stk); Elm *sp;

// push
VecChr_resizeDiff(stk, + sizeof (Elm)); sp = (Elm *) &stk->p[stk->n - sizeof (Elm)];
sp->i = 123; sp->s = "hello";

printf("stack-top = [%d, %s]\n", sp->i, sp->s);

// pop
VecChr_resizeDiff(stk, - sizeof (Elm)); sp = (Elm *) &stk->p[stk->n - sizeof (Elm)];
void *VecChr_stkPush(VecChr *w, intptr_t sz) { VecChr_resizeDiff(w, + sz); return w->p + w->n - sz; }
void *VecChr_stkPull(VecChr *w, intptr_t sz) { VecChr_resizeDiff(w, - sz); return w->p + w->n - sz; }

sp = VecChr_stkPush(stk, sizeof (Elm)); sp->i = 123; sp->s = "hello";
sp = VecChr_stkPull(stk, sizeof (Elm));

2026.01.29(木) #0

2026.01.29(木) #1

2026.01.29(木) #2

2026.01.29(木) #3

2026.01.30(金) #0

2026.01.30(金) #1

2026.02.02(月) #0

2026.02.02(月) #1

2026.02.03(火) #0

2026.02.03(火) #1

2026.02.03(火) #2


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS