CoderBridge
  • 探索
  • 閱讀
  • 學習
  • 贊助
  • 社群
會員登入

CS50 Call Stack


adrianwudev in CS 50
Sep 03, 2022

Call Stack

int fact(int n)
{
    if (n==1)
        return 1;
    else
        return n * fact(n - 1);
}
int main(void)
{
    printf("%i\n", fact(5));
}

This recursive function would look like this in Stack Memory

// a lot of call stack, which will release as the function done one by one from the top one.

fact(1)
fact(2)
fact(3)
fact(4)
fact(5)
printf()
main()
#cs50 #memory #stack #call stack


0 0 0



adrianwudev


你可能感興趣的文章

C# The way to store a temporary data: Memory Cache, Redis

C# The way to store a temporary data: Memory Cache, Redis

adrianwudev
Kotlin 練功場 - Ktor

Kotlin 練功場 - Ktor

JingTeng
筆記、[ALG101] 虛擬碼

筆記、[ALG101] 虛擬碼

s103071049





留言討論





解決方案

  • 功能特色
  • FAQ 常見問題
  • Changelog

社群

  • 加入我們的 Discord
  • 建議回饋與功能許願
  • Facebook 粉絲專頁

公司

  • 官方部落格
  • 聯絡我們
  • Follow @CoderBridgeHQ

Country/Region


© Copyright 2022 CoderBridge, Inc. All rights reserved. Various trademarks held by their respective owners. Special Thanks to Freepik. 墨俠科技:83783964.
歡迎回家
使用 Github 帳號登入 使用 Google 帳號登入
免費加入 CoderBridge
使用 Github 帳號註冊 使用 Google 帳號註冊