C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 2nd, 2007, 09:47 AM
slammer360 slammer360 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 8 slammer360 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 52 sec
Reputation Power: 0
"ISO" error on compiler ???

Hey guys, im having this problem with my compiler or my code, i dont know which one. everytime i tell it to compile this code, it gives the error "ISO", and i have no idea what that means. here is the code. it happens on lines 15, 19, 23, and all the other if and else if and else lines. whats the problem?

#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;

int Aa = 0, Ee = 0, Ii = 0, Oo = 0, Uu = 0;
int counter;
string str;

int Vowelcount (int Aa,int Ee,int Ii,int Oo,int Uu,string str,int counter)
{
for (counter = 0; (counter - 1) > str.length(); counter++)
{
if (str[counter] == "a")
{
Aa = Aa + 1;
}
else if (str [counter] == "e")
{
Ee = Ee + 1;
}
else if (str [counter] == "i")
{
Ii = Ii + 1;
}
else if (str [counter] == "o")
{
Oo = Oo + 1;
}
else if (str [counter] == "u")
{
Uu = Uu + 1;
}
}
cout << Aa << "\t" << Ee << "\t" << Ii "\t"
<< Oo << "\t" << Uu << endl;
return 0;
}
int main ()
{
cout << "enter a string" << endl;
cin >> str;
counter = 0;
Vowelcount(Aa, Ee, Ii, Oo, Uu, str, counter);
system{"PAUSE");
return 0;
}

Reply With Quote
  #2  
Old March 2nd, 2007, 04:22 PM
ubergeek ubergeek is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 ubergeek User rank is Private First Class (20 - 50 Reputation Level)ubergeek User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 14
Send a message via AIM to ubergeek
The "ISO" is not the important part of the error, look at the rest. Anyways, str[counter] is a single char and you compare it to "a", which is actually a string. You meant to compare it to 'a', a character.

Reply With Quote
  #3  
Old March 3rd, 2007, 10:18 AM
slammer360 slammer360 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 8 slammer360 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 52 sec
Reputation Power: 0
thanks ubergeek

hey ubergeek thanks for the help i got it to take away the ISO error, by the way that was all that was shown, but now when im in runtime, it returns 0 for the variable Aa. whats happening now?

Reply With Quote
  #4  
Old March 3rd, 2007, 01:34 PM
ubergeek ubergeek is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 ubergeek User rank is Private First Class (20 - 50 Reputation Level)ubergeek User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 14
Send a message via AIM to ubergeek
I'm not quite sure, my psychic powers are off today. What is the updated code? And what did you give it as input?

Reply With Quote
  #5  
Old March 4th, 2007, 09:33 AM
slammer360 slammer360 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 8 slammer360 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 52 sec
Reputation Power: 0
hey thanks again ubergeek heres the code

#include <cstdlib>
using namespace std;

int Aa = 0, Ee = 0, Ii = 0, Oo = 0, Uu = 0;
int I;
string str;

int Vowelcount (int Aa,int Ee,int Ii,int Oo,int Uu,string str,int I)
{
for (I=0;I>str.length();I++)
{
if (str [I] == 'a')
{
Aa = Aa + 1;
}
else if (str [I] == 'e')
{
Ee = Ee + 1;
}
else if (str [I] == 'i')
{
Ii = Ii + 1;
}
else if (str [I] == 'o')
{
Oo = Oo + 1;
}
else if (str [I] == 'u')
{
Uu = Uu + 1;
}
}
return Aa;
}
int main ()
{
cout << "enter a string" << endl;
cin >> str;
Vowelcount(Aa, Ee, Ii, Oo, Uu, str, I);
cout << Aa;
string red;
cin >> red;
return 0;
}

Reply With Quote
  #6  
Old March 4th, 2007, 01:35 PM
ubergeek ubergeek is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2005
Posts: 600 ubergeek User rank is Private First Class (20 - 50 Reputation Level)ubergeek User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 14
Send a message via AIM to ubergeek
Your organization doesn't make much sense to me. You have Aa and the rest as global variables (so all functions can access them), but then you pass them to Vowelcount() anyways. Then Vowelcount returns a value, but you ignore it and output the global variable instead (this is why you see 0 output--the global variable was copied when you passed it to Vowelcount and never modified). Review global variables and function parameters/return values.

Reply With Quote
  #7  
Old March 5th, 2007, 01:03 PM
slammer360 slammer360 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 8 slammer360 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 52 sec
Reputation Power: 0
hey thankyou so much ubergeek that was mighty bitchin in the kitchen.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > "ISO" error on compiler ???


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap