LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-18-2010, 11:17 PM   #1
lakshmi kapakayala
LQ Newbie
 
Registered: May 2010
Posts: 1

Rep: Reputation: 0
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);
}
~
~
~
 
Old 05-18-2010, 11:22 PM   #2
brucehinrichs
Member
 
Registered: Mar 2008
Location: US
Distribution: Debian Sid; Sabayon, UbuntuStudio, Slackware-multilib 13.1, Peppermint Ice, CentOS
Posts: 575

Rep: Reputation: 67
Um, that's cool. Did you have a question?
 
Old 05-19-2010, 12:06 AM   #3
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,508

Rep: Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894Reputation: 1894
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??
 
  


Reply

Tags
programing


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
warning: passing argument 3 of ‘pthread_create’ from incompatible pointer type eCli Programming 1 01-19-2009 07:44 AM
warning: passing argument 2 of ‘memset’ makes integer from pointer without a cast nasim751 Programming 3 01-30-2008 09:16 AM
What is the warning: passing arg 3 of `pthread_create' from incompatible pointer type wallwaters Linux - Software 3 06-01-2005 08:30 AM
makes pointer from interger without a cast y0shi Linux - General 4 10-21-2004 08:17 PM
C programming error. warning: comparison between pointer and integer Linh Programming 4 06-06-2003 03:49 PM


All times are GMT -5. The time now is 09:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration