0

So I have char array and in each index of array I have a piece of picture that I need to write in console. In one function I have array and in other function I have the output. The problem is that in output I only get first element, I also tried without [i], with & or *. But nothing worked corectly.

Code

4
  • 4
    please paste your code into the question rather than an image Dec 7, 2015 at 20:30
  • 5
    so is this c++ or c#? half c++ half c#? c+#? Dec 7, 2015 at 20:32
  • @M.kazemAkhgary That last comment of yours made my day!
    – Codor
    Dec 7, 2015 at 20:34
  • "So I have char array..." No, you have an array of char*. The two are vastly different. Dec 7, 2015 at 20:51

1 Answer 1

3

The call should be

output(array, max);

instead of

output(*array,max);

which uses an unintended dereferencing of array.

2
  • 1
    The output should be declared differently, too.
    – n0rd
    Dec 7, 2015 at 20:40
  • Yes, but how? I'm not deeply involved in C++ currently. The intention is to declare an array of strings; how should it be done? As char** array ?
    – Codor
    Dec 7, 2015 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.