Here i have problem with ctype.h library .I think i use correctly,but i ahve an error on it.
This is the code.

#include<iostream>
#include <ctype.h>
using namespace std;
int main(){
	char letter;
	int num;
	int isdigit(int letter);
	int  isupper (int letter);
	int islower( int letter);
	int small=0;
	int capital=0;
	int number=0;
	int special=0;

	 cout<<"Enter any number and letter you like,'+'means   exit";
	 /* use if statement to help user to count how many times s/he enter letter*/
   for(int i=0;i<=5;i++)  //any number greater than one
	{     //start while here
	

	  cin>>letter; //user enter a number
	  if (letter==isdigit(letter))
		  number++;
	  if(letter==isupper(letter))
		capital++;  //counting capital letter
	  else  if(letter==islower(letter))
		  small++;  //in case enter small, letter counting small letter
	  
	  else if(letter!=isupper(letter) && letter!=islower(letter) && num!=isdigit(num))
		  special++;  /*if the user enter a sepcial                                    chraecter*/

   }
	  
	
	

      cout<<number<<endl<<small<<endl<<capital<<endl<<special;
return 0;
}

'is' functions return a boolean result ('is' true or isn't true, otherwise known as false).

So

if ( isdigit(letter) ) {
  number++;
}

Oh, and in C++, use #include <cctype>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.