0

I have explicity declared my array to be 450 characters long.

But for some reason when I run the program I seem to be getting about 475 characters and they are all -52(ascii) from 450 to 475. I also do not seem to have a null character in my array to tell the program it is the end of the array.

Anyone can help me out?

Thanks

Edited by james6754: n/a

2
Contributors
6
Replies
7
Views
5 Years
Discussion Span
Last Post by thines01
0

How does our process handle carriage-returns and linefeeds?
Also, what is the final result you're trying to achieve?

Edited by thines01: clarity

0

Ok...so I have rejigged it a bit...I'm not great at c++...(usually doing C#)

I have a char array holding 446 characters..

some sorting gets done on that and this char array is then placed in to a string. This string is passed in to a function and for some reason this string becomes 472 characters long.

Would you like to see some code? Or maybe you know from telling you that...

0

The end result is to output readable text on to the console that has been decrypted. It is showing 472 characters when I only want 446 characters to show. (characters 446 - 472 are some random characters that seem to be added on the end)

0

I have done it now by sending in the size of the array to the function and saying while a variable is less than the sizeof the array.

But I would still be interested to know why this is happening if you or anybody else knows! Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.