LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-06-2003, 01:36 PM   #1
pimaster
LQ Newbie
 
Registered: Nov 2003
Location: Las Vegas
Posts: 1

Rep: Reputation: 0
Question ISO C++ forbids comparison between pointer and integer?


We have to write a program that counts vowels in a file, and I keep getting the error message
"ISO C++ forbids comparison between pointer and integer" on line 27...

25 bool isvowel(char letter)
26 {
27 if (letter=="A" || letter=="E" || letter=="I" || letter=="O" || letter=="U" )
28 return true;
29 else
30 return false;
31 }

what does the error mean and how do I fix it?
 
Old 11-06-2003, 01:45 PM   #2
jhorvath
Member
 
Registered: Sep 2002
Location: OH, USA
Distribution: 2.6.16-1.2096_FC5 #1
Posts: 245

Rep: Reputation: 30
you don't use double quotes (") for character constants ..use single quotes (').
 
  


Reply



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
printk --- ISO C90 forbids mixed declaration and code Igor007 Programming 3 09-08-2005 04:05 AM
Comparison between pointer and integer ---> WHY?? its_godzilla Programming 10 01-28-2005 09:40 PM
makes pointer from integer without a cast ? hubabuba Programming 2 01-28-2005 05:28 PM
pointer from integer without a cast bcf2 Programming 7 12-30-2004 02:04 PM
C programming error. warning: comparison between pointer and integer Linh Programming 4 06-06-2003 03:49 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:50 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration