【发布时间】:2014-12-07 13:05:42
【问题描述】:
有人能指出这段代码中的错误吗?我正在使用codingblocks IDE。
#include <stdio.h>
main()
{
char a[100],b[100];int i,j=0;
scanf("%s",&a);
for(i=strlen(a)-1,j=0;i>=0;i--)
{
b[j]=a[i];
j=j+1;
}
b[j]='\0';
if(a==b) # on printing i get both 'a' and 'b' as equal however this condition still remains
# false
printf("true"); #doesnot print?
}
【问题讨论】:
-
#不是C中的评论字符。
标签: c logic palindrome