homeskating 发表于 2023-2-4 10:36:07

&在C伪码函数中表达的是什么意思?

//插入元素e为新的栈顶元素
SqStack Push(SqStack &S, int e) {
        if (S.top - S.base >= S.stacksize) {
                //栈满追加存储空间
                S.base = (int *)realloc(S.base, (S.stacksize + STACKINCREMENT) * sizeof(int));
        }
        if (!S.base) {
                //存储分配失败
                exit(ERROR);
        }
        S.top = S.base + S.stacksize;
        S.stacksize += STACKINCREMENT;
        printf_s("e=%d\n", e);
        *S.top++ = e;
        printf_s("*(S.top)=%d\n", *(S.top - 1));
        return S;
}

ba21 发表于 2023-2-4 10:36:08

&S c++中传址。
页: [1]
查看完整版本: &在C伪码函数中表达的是什么意思?