Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,558 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,605 people online right now. Registration is fast and FREE... Join Now!




term does not evaluate to a function taking 1 arguments

 
Reply to this topicStart new topic

term does not evaluate to a function taking 1 arguments

alberts613
22 Nov, 2007 - 11:11 AM
Post #1

New D.I.C Head
*

Joined: 21 Nov, 2007
Posts: 3


My Contributions
not sure why I keep getting this error.

CODE

while(counter <= size1){                                    //test for letters while the location
       if((phrase1[counter] == 'A' || phrase1[counter] == 'a')
          (phrase1[counter] == 'B' || phrase1[counter] == 'b')  //ERROR HERE
          (phrase1[counter] == 'C' || phrase1[counter] == 'c')
          (phrase1[counter] == 'D' || phrase1[counter] == 'd')
          (phrase1[counter] == 'E' || phrase1[counter] == 'e')
          (phrase1[counter] == 'F' || phrase1[counter] == 'f')
          (phrase1[counter] == 'G' || phrase1[counter] == 'g')
          (phrase1[counter] == 'H' || phrase1[counter] == 'h')
          (phrase1[counter] == 'I' || phrase1[counter] == 'i')
          (phrase1[counter] == 'J' || phrase1[counter] == 'j')
          (phrase1[counter] == 'K' || phrase1[counter] == 'k')
          (phrase1[counter] == 'L' || phrase1[counter] == 'l')
          (phrase1[counter] == 'M' || phrase1[counter] == 'm')
          (phrase1[counter] == 'N' || phrase1[counter] == 'n')
          (phrase1[counter] == 'O' || phrase1[counter] == 'o')
          (phrase1[counter] == 'P' || phrase1[counter] == 'p')
          (phrase1[counter] == 'Q' || phrase1[counter] == 'q')
          (phrase1[counter] == 'R' || phrase1[counter] == 'r')
          (phrase1[counter] == 'S' || phrase1[counter] == 's')
          (phrase1[counter] == 'T' || phrase1[counter] == 't')
          (phrase1[counter] == 'U' || phrase1[counter] == 'u')
          (phrase1[counter] == 'V' || phrase1[counter] == 'v')
          (phrase1[counter] == 'W' || phrase1[counter] == 'w')
          (phrase1[counter] == 'X' || phrase1[counter] == 'x')
          (phrase1[counter] == 'Y' || phrase1[counter] == 'y')
          (phrase1[counter] == 'Z' || phrase1[counter] == 'z')){
              newphrase1[counter2] = phrase1[counter];
              counter++;                              
              counter2++;
       }
       else{
           counter++;
       }
    }

MOD EDIT: code tags added: code.gif
User is offlineProfile CardPM
+Quote Post

Alek86
RE: Term Does Not Evaluate To A Function Taking 1 Arguments
22 Nov, 2007 - 11:17 AM
Post #2

New D.I.C Head
*

Joined: 5 Nov, 2007
Posts: 6

usually this error shows when there are no closing brackets

hm...

CODE

...
(phrase1[counter] == 'C' || phrase1[counter] == 'c')
(phrase1[counter] == 'D' || phrase1[counter] == 'd')
...


what is this? maybe you wanted do write something like:

CODE

...
(phrase1[counter] == 'C' || phrase1[counter] == 'c') ||
(phrase1[counter] == 'D' || phrase1[counter] == 'd')
...



This post has been edited by Alek86: 22 Nov, 2007 - 11:19 AM
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Term Does Not Evaluate To A Function Taking 1 Arguments
22 Nov, 2007 - 12:03 PM
Post #3

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,868



Thanked: 53 times
Dream Kudos: 550
My Contributions
...there is an "isalpha()" function.

you can also write your own. All characters happen to have numeric values in the computer, for example A is 65 and Z is 90... So you can use a little logic to work things out:

CODE
char testchar = phrase1[counter];
if (testchar >= 'A' && testchar <= 'Z') {
// this is a capital letter...
} else if (testchar >= 'a' && testchar <= 'z') {
// this is a lower case letter
}

if ((testchar >='A' && testchar <= 'Z') || (testchar >='a' && testchar <= 'z')) {
//this is a alphabet character
}

[/code]
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/7/09 10:06PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month