計算機概論 - 考試
By Una
at 2013-06-12T23:19
at 2013-06-12T23:19
Table of Contents
[考題] 國考歷屆考題與考題觀念討論(書裡看到的選這個)請附上想法、出處
void f(int *p,int a[]) { p=a;} //*(p)=1
void main()
{
int a[]={1,3,5,7};
int *p=&a[1];
f(p,a);
//*(p)=3
p++;
cout<<*(p);
//*(p)=5
}
想法: p不是指標嗎?
為什麼離開 f function 後
p值仍未改? call by value?
考題出處 101年中華電信考題
--
void f(int *p,int a[]) { p=a;} //*(p)=1
void main()
{
int a[]={1,3,5,7};
int *p=&a[1];
f(p,a);
//*(p)=3
p++;
cout<<*(p);
//*(p)=5
}
想法: p不是指標嗎?
為什麼離開 f function 後
p值仍未改? call by value?
考題出處 101年中華電信考題
--
Tags:
考試
All Comments
By Edith
at 2013-06-14T08:45
at 2013-06-14T08:45
By Daph Bay
at 2013-06-14T20:03
at 2013-06-14T20:03
By Lydia
at 2013-06-15T07:39
at 2013-06-15T07:39
By Hedda
at 2013-06-18T20:45
at 2013-06-18T20:45
By Kristin
at 2013-06-20T20:50
at 2013-06-20T20:50
By Connor
at 2013-06-21T00:50
at 2013-06-21T00:50
By Franklin
at 2013-06-24T12:50
at 2013-06-24T12:50
By Yedda
at 2013-06-26T23:38
at 2013-06-26T23:38
Related Posts
98年地特基本電學
By Daph Bay
at 2013-06-12T23:03
at 2013-06-12T23:03
經濟學問題
By Donna
at 2013-06-12T22:55
at 2013-06-12T22:55
中級會計學(現金流量表)
By Franklin
at 2013-06-12T22:36
at 2013-06-12T22:36
企業管理
By Blanche
at 2013-06-12T22:33
at 2013-06-12T22:33
6/21 高醫旁 住宿share
By William
at 2013-06-12T22:31
at 2013-06-12T22:31