Ok, How big is your program? If it doesn't fit into 1 or 2 posts, then post it on coliru-stacked say
linebuffer[] is the following character string at beginning of first iteration:
"0 o 0" ( o is alphabet[0] )...
|
Just noticed, linebuffer[1] is a space char (ascii value 32), so
i = linebuffer[1] - '0'
is -16 because 0 is ascii 48, hence out of bounds access. Why didn't that show up in your output?
How is the 'o' alphabet[0] ?
Edit: I see form line 11, but arrays start a t 0, so linebuffer[3] is 'space'
Also linebuffer[5] is garbage because you only assigned 5 chars to it, the last one is linebuffer[4], array start at zero.
To avoid problems like this, don't hard code numbers into your code. Obtain the length of the string and make use of that variable.
...... but it is telling me transTable is out of scope which it is not because it is global... |
If it is telling you it is out of scope, then it is.
using g++ in backend of netBeans. |
great, you can use the same warnings as me. I also have a clang++ compiler, it gives easy to read warnings and has basically the same warnings as gcc