Your book will explain this concept very easily. And like I said, Thinking In C++ is free online. You aren't declaring your parameters to your function as a pointer. Try reading what I said again, and actually read it. Nobody likes to answer peoples questions if they can't even do the research themselves.
- i did read what you wrote. since much of your answer was based on a bad paste, i didn't comment further.
- you wrote: "Just because you are using pointers does not mean the laws of the language have changed. In this, r is a local variable containing one value which is an integer." well, i don't want 'r' to be a local integer. i want it to accept the address of 'p' in the scope of exec() and store it in another pointer. thus, i'm not finding any reference in my books or the internet for this answer. hence my reason for posting it here.
- no need to get snitty. if ur finished offering suggestions, then thanks. i'll look for 'thinking in c++' and see what else i can find.
- my professor tells me to use this:
It should read:
PopulateArray(p, size);
:
:
void PopulateArray(int * p, int size)
{
:
}
however, when i compile this, i get: 'PopulateArray': cannot convert parameter 1 from 'int *' to 'int'
so, as you can see, the professor hasn't been much help on this. another reason for this journal.
although it's an old book, it looks like a good reference. unfortunately, he's referencing a style of c++ that i am not learning. regarding pointers and functions, he references "int*" and "int&" which i haven't been taught. the handling is much different than the functions my professor is looking for. thanks anyway.
btw, if anyone else wants the book, you can get it here: planet pdf
although this is a different method, it made me look at the error message in a different way. it appears the function prototype was wrong. it needed to be: PopulateArray(int *, int), not (int, int). Because we have been learning about "*p" and "*r" and not "int*", i wasn't seeing the need to change to prototype. now with my newfound powers...