Click here to Skip to main content
14,605,926 members

C / C++ / MFC

 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan29-Mar-20 6:55
mveRichard MacCutchan29-Mar-20 6:55 
GeneralRe: Passing an array as argument to a function Pin
Greg Utas29-Mar-20 7:07
professionalGreg Utas29-Mar-20 7:07 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan29-Mar-20 7:20
mveRichard MacCutchan29-Mar-20 7:20 
GeneralRe: Passing an array as argument to a function Pin
Greg Utas29-Mar-20 7:50
professionalGreg Utas29-Mar-20 7:50 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan29-Mar-20 21:07
mveRichard MacCutchan29-Mar-20 21:07 
GeneralRe: Passing an array as argument to a function Pin
Greg Utas30-Mar-20 2:40
professionalGreg Utas30-Mar-20 2:40 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan30-Mar-20 3:28
mveRichard MacCutchan30-Mar-20 3:28 
GeneralRe: Passing an array as argument to a function Pin
Greg Utas30-Mar-20 3:35
professionalGreg Utas30-Mar-20 3:35 
I agree that it should crash there. But I've never seen it work that way, though for most of my career I worked in a language where it would have crashed there.

It's not unusual to dereference a pointer (pi) and pass it to an argument that wants a reference.

GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan30-Mar-20 4:04
mveRichard MacCutchan30-Mar-20 4:04 
GeneralRe: Passing an array as argument to a function Pin
Greg Utas30-Mar-20 4:11
professionalGreg Utas30-Mar-20 4:11 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan30-Mar-20 4:24
mveRichard MacCutchan30-Mar-20 4:24 
GeneralRe: Passing an array as argument to a function Pin
k505430-Mar-20 4:58
mvek505430-Mar-20 4:58 
GeneralRe: Passing an array as argument to a function Pin
k505429-Mar-20 7:52
mvek505429-Mar-20 7:52 
GeneralRe: Passing an array as argument to a function Pin
CalinNegru(fearless_)29-Mar-20 8:11
MemberCalinNegru(fearless_)29-Mar-20 8:11 
GeneralRe: Passing an array as argument to a function Pin
k505429-Mar-20 9:42
mvek505429-Mar-20 9:42 
GeneralRe: Passing an array as argument to a function Pin
CalinNegru(fearless_)30-Mar-20 22:30
MemberCalinNegru(fearless_)30-Mar-20 22:30 
GeneralRe: Passing an array as argument to a function Pin
CalinNegru(fearless_)31-Mar-20 21:36
MemberCalinNegru(fearless_)31-Mar-20 21:36 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan31-Mar-20 23:02
mveRichard MacCutchan31-Mar-20 23:02 
GeneralRe: Passing an array as argument to a function Pin
CalinNegru(fearless_)31-Mar-20 23:26
MemberCalinNegru(fearless_)31-Mar-20 23:26 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan1-Apr-20 0:36
mveRichard MacCutchan1-Apr-20 0:36 
GeneralRe: Passing an array as argument to a function Pin
CalinNegru(fearless_)1-Apr-20 1:12
MemberCalinNegru(fearless_)1-Apr-20 1:12 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan1-Apr-20 1:26
mveRichard MacCutchan1-Apr-20 1:26 
GeneralRe: Passing an array as argument to a function Pin
CalinNegru(fearless_)1-Apr-20 1:49
MemberCalinNegru(fearless_)1-Apr-20 1:49 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan1-Apr-20 2:45
mveRichard MacCutchan1-Apr-20 2:45 
GeneralRe: Passing an array as argument to a function Pin
CalinNegru(fearless_)1-Apr-20 5:19
MemberCalinNegru(fearless_)1-Apr-20 5:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.