I am trying to read a decimal as a char and store it in an array by ignoring "." like if I have 0000.9876 will be stored as 9876. The program works fine...but it doesn't stop when i debug it.....I need help please ...........
#include<iostream>
#include <ctype.h>
using namespace std;
int main()
{
char Ch;
char Number[20];
int l=0,k=0,j=0,NumberOfDigits;
cin.get(Ch);
while( k<20 &&(Ch = cin.get() ) != 0 )
{
if(Ch=='.')
{
while ( l<20 )
{
cin.get(Ch);
if(isdigit(Ch))
{
Number[l]=Ch-'0';
cout<<int(Number[l]);
l++;
}
}
k++;
}
}
NumberOfDigits=l;
}