Home > database >  Programming: decide whether a character in a string of number, if you don't appear it returns 0
Programming: decide whether a character in a string of number, if you don't appear it returns 0

Time:12-22

, I saw the along while also look not to understand what is going wrong,
#include
using namespace std;
Int main ()
{char a, [10].
Char * p;
char c;
int sum=0;
cout<" Please input a string: ";
for(int i=0; i<=9; I++)
Cin> A, [I].
cout<" Please enter the characters you want to find: ";
Cin> c;
For (p=a; * p!='\ 0'; P++)
{if (* p=='c')
Sum++;
The else sum;
}
Cout & lt; return 0;
}

  • Related