PDA

Click to See Complete Forum and Search --> : problem with data type


omarali
Jul 3rd, 2007, 07:14 PM
Hi :wave:
I tried to declare avariable tgelephoneNo as an int or long but dose not work when insert a numer like 01992 787878 it said int to large same as for the long, could you please tellme what is wrong

eranga262154
Jul 4th, 2007, 12:42 AM
Is there a space, if so it is wrong.

eranga262154
Jul 4th, 2007, 01:02 AM
You can't start with 0.

And also, maximum value of int is 232 - 1. You exceeded that limit in int type.

In long type use postfix 'L' to indicate it is a long value.

ComputerJy
Jul 4th, 2007, 03:21 AM
Telephone numbers are strings not integers

eranga262154
Jul 4th, 2007, 09:31 PM
Ya, if you want to add it with zero and space, better to make them as Strings.