首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

:assignment makes integer from pointer without a cast|

2012-04-15 
求救:assignment makes integer from pointer without a cast|请问谁告诉我出现的原因是什么?怎么解决?多

求救:assignment makes integer from pointer without a cast|
请问谁告诉我出现的原因是什么?怎么解决?多谢了!!! 
#include <stdio.h>
main()
{
  int c,nl,tab,space;
  tab=0;
  space=0;
  nl= 0;
  while ((c=getchar())!= EOF){
  while (c="\n"){
  nl=nl+1;}
  while (c=" "){
  space=space+1;}
  while (c="\t"){
  tab=tab+1;}
  }printf("%d\n", space);
}


[解决办法]
while (c="\t"){
改为 if( c == '\t' ) {

除了第一个while之外,另外3个while都这么改。。
[解决办法]
谢谢,但是我一enter不动了

while (c==‘\n’){
nl=nl+1;
}

进入死循环。。。。当然不动了。

应该这样,记录一个“回车”输入
while (c==‘\n’){
nl=nl+1;
break;
}

热点排行