I am a beginner and have a problem now, I have defined a complex number class which defined the complex numbers and operations (+,-,*,/), now I want to pass the complex number to a function, how do I do that? can I use a pointer?
could I claim complex<double>** b ( b is a 2D complex number array), and could I pass b to a function ?
for example
You are being clear, I think. What is not clear to me is why you are asking this instead of testing it yourself. It takes only a minute to test as opposed to waiting for a Yes/No answer. So maybe you are even asking the wrong question? Are you having trouble with the above code? Error messages of any kind?
Summary: Don't ask this, just test! If it doesn't work, then post your current non-working code, post errors, then describe what you want.
Thanks a lot anyway. I did test a lot, and the error information confused me a lot. there are so many same errors that said the variables a and b are not identified. I claim
1d array like this
complex<double>* r = (double*)calloc(NNMAX, sizeof(double));
and 2d array like this
I am not sure now if there is something wrong during my allocations, because I can't read that information from the error code.
if I did it right with the allocations, I know I have to check other problems.