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 Commented Dec 7, 2015 at 20:30
  • 5
    so is this c++ or c#? half c++ half c#? c+#? Commented Dec 7, 2015 at 20:32
  • @M.kazemAkhgary That last comment of yours made my day! Commented Dec 7, 2015 at 20:34
  • "So I have char array..." No, you have an array of char*. The two are vastly different. Commented 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.

Sign up to request clarification or add additional context in comments.

2 Comments

The output should be declared differently, too.
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 ?

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.