※ 本文轉寄自 ptt.cc, 文章原始頁面
[問題] 用函數設定參照的問題
各位晚安打擾了
https://onlinegdb.com/_DyNuxd2H
我一直不太明白為什麼為什麼這樣寫是合法的
f(a)=5這行不是在把function call設值嗎
但是照理來說只能assign value給變數吧?(gpt這樣跟我講的,但是他又說我的例子不是
設值給f(a)@@)
不好意思我好像越問越基本了...謝謝大家
----
Sent from BePTT on my OPPO CPH1943
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 112.78.70.250 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1699705889.A.42E.html
85 則留言
amamoimi 作者的近期文章
[問題] temporary 可以take reference 嗎?
c++新手最看了一些文章,發現一個問題,舉個例子: #include <iostream> class A{ public: int a=5; int& g(){ return a; } A f(){ return *t
[問題]char 指標問題
不好意思我程式新手又來擾民了@@ https://onlinegdb.com/Vm941gQ0_ 這是我在書上看到的程式碼 功能是把變數byte by byte的交換 但是我看不太懂那個swap函數... 為什麼可以隨便把參數冠上一個(ch
[問題] 遞迴函數的變數儲存
不好意思又是我c++新手 想問一個問題 舉個例子 #include<iostream> using namespace std; void f(int); int main(){ f(2); return 0;} void f(
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
→
推
→
→
→
→
→
推
→
→
→
→
推
→
→
→