You need to allocate one more space for null character.....
and after for loop add this line
encryption[45]='\0'';
That will be out of bounds.any other ideas?If you intend to use standard C-style string functions, they do require null termination. Otherwise, you could use looping or a function such as memcpy. And of course, you can't print a non-null-terminated with functions expecting null-terminated strings.
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
I don't suppose you could post a minimal snippet that demonstrates the problem?
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314