Some compilers will assume that 0 means nullptr. Change the pointer, and it'll work. Otherwise you'll have to dereference piNumbers in both of your for loops.
Then I try to do this with int... I can set the whole array to 0...
But when I try to put some other value, like 6, I get an error...
I understand what have you shown me above, I just need an explanation why I can set it to 0, but not to 6...
I would appreciate if you correct me if I did any grammatical errors in my posts...
Thanks...
From the C++ Standard : "1 A null pointer constant is an integral constant expression (5.19) prvalue of integer type that evaluates to zero or a prvalue of type std::nullptr_t. A null pointer constant can be converted to a pointer type; the result is the null pointer value of that type and is distinguishable from every other value of pointer to object or pointer to function type. Such a conversion is called a null pointer conversion."
In function 'int main()'
8|error: expected type-specifier before '*' token|
8|error: expected ',' or ';' before 'int'|
||=== Build finished: 2 errors, 0 warnings ===|
vlad from moscow please ignore my posts... Your first post was what I already know(create an array an copy it's address to another location pointed by piNumbers)... The second post was the rule from the C++ Standard... The third post above, you showed me the working code... Instead of yelling, you could explain the diference between the examples with your own words...