![:(](./images/smilies/icon_frown.gif)
I'll get back to it once the queue clears, and hopefully that was the only thing wrong. Thanks for taking a look though!
Moderator: Board moderators
Thanks for the update. Fantastic work! Glad your debugging went well.johncip wrote:I had a typo when checking for character zero, meant '\0' but write '0'. And to top it off, I think that check was unnecessary (included it before I had hard grid bounds), so it wasn't doing anything but introducing the bug
Let us know how it goes.I'll get back to it once the queue clears, and hopefully that was the only thing wrong.
Glad you figured it out. Well done!johncip wrote:Got it now, thanks. I suppose now I'll be more careful about character zero. I like to use '\0' since it stands out more as a special value in the code, if that makes any sense. But it makes that sort of typo possible, so maybe it's not a great idea.
Code: Select all
'0'
Code: Select all
'\0'
Code: Select all
Use code tags
Code: Select all
"R
Ie
n
te
h <-extra space here
iD
ne
kc
,a
r
tt
he
es
r <-extra space here
eo
fn
oc
re
e <-extra space here
s
Ia
i
ad
m,
. <-extra space here
" <-extra space here
Code: Select all
while(j--)
{
if (a[j][k] == '\0') a[j][k] = ' ';
printf("%c",a[j][k]);
}
Code: Select all
a
bb
ccc
dddd
eeeee
ffff
ggg
Code: Select all
gfedcba
gfedcb
gfedc
fed
e
Code: Select all
while(gets(a[i]))
{
x=strlen(a[i]);
a[i][x] = ' ';
if(x>maxi) maxi=x;
i++;
}
Code: Select all
removed
Code: Select all
char s[105][105];
memset(s, 0, sizeof(s));