View Single Post
Old 11-03-2003, 08:45 PM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
also, after looking at it .. if your code is correct, then it appears your logic is wrong:
Code:
if (isdigit(date[x]))
{
  cout << "Please enter a date dd/mm/yyyy: ";  
  else  
  cout << "Entry Valid\n";  
};  // should there be a ';' at the end of this line?
assuming isdigit would return true/false with that if statement, if it 'is a digit' then it would ask you to please enter a date .. and if it 'is not a digit' then it would say entry valid.

also, that semi colon at the end of the '}' .. are you sure that goes there? i really don't know . just doesnt' look right.

i think it should be more like this:
Code:
if (!isdigit(date[x]))
{
  cout << "Please enter a date dd/mm/yyyy: ";  
}
else
{
  cout << "Entry Valid\n";  
}
p.s. i'm no c++ expert .. so take my advice with a grain of salt .. just tryin to help if i can.
__________________
Mike
sde is offline   Reply With Quote