Re:Confessions of an Intermediate Programmer
by Nursie on Tuesday March 04, 2014 @09:31AM
(#7340329)
I meant passing a pointer rather than a by-ref call (which is indeed C++ only).
i.e. void myfunc(thing* stuff) { return; }
int main() { thing stuff; myfunc(&stuff); }
Re:Confessions of an Intermediate Programmer
by doktrin on Tuesday March 04, 2014 @02:59PM
(#7342645)
Oh, totally agreed. What I had difficulty with, specifically, was passing around a struct that contained a multidimensional array of a size determined at runtime.
I'm sure the problems I had could be solved by either a full re-design (not really an option), or accomplished by someone with more C experience.
Re:Confessions of an Intermediate Programmer
by ATLobotomy on Wednesday March 05, 2014 @01:09AM
(#7345621)
It shouldn't matter what the struct is holding, you are passing a pointer, it's always the same size.
AFAIK, that's only a legal function signature in C++.
To the point of the question : when I wrote that, I was specifically thinking of 2-dimensional arrays, not structs per se.