LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   warning in c about comparision between pointer and interger (http://www.linuxquestions.org/questions/linux-newbie-8/warning-in-c-about-comparision-between-pointer-and-interger-808742/)

lakshmi kapakayala 05-18-2010 11:17 PM

warning in c about comparision between pointer and interger
 
hai!
i got a warning saying that comparision between pointer and interger








#include<stdio.h>
#include<string.h>
main()
{
char s[80];
int i,j,count=0;
printf("enter the string");
scanf("%s",s);
for(s[i]=0;s[i]<=strlen(s);s[i++])
{
if(s[i]=="\n"||s[i]==" "||s[i]=='\t')
count++;
}

printf("%d",count);
}
~
~
~

brucehinrichs 05-18-2010 11:22 PM

Um, that's cool. Did you have a question?

grail 05-19-2010 12:06 AM

And even if you don't, I have a question, what the???
Code:

for(s[i]=0;s[i]<=strlen(s);s[i++])
Are we also to surmise that you have not written any C code before??


All times are GMT -5. The time now is 03:27 AM.