+ 2
Why there is data type when I can just write doller sign ?
6 Answers
+ 3
Sema Abuel Nour
I believe php variables automaticaly get assigned datatypes, based on the values.
the dollar sign is part of the syntax for declaring a variable.
+ 1
Sorry I do not know which language you are refering to.
please provide more details and code, to understand your question better.
+ 1
I mean php language
+ 1
I think in C# you can use char.... Is that correct?
0
Variable name is just a pointer to a certain memory region. Data type tells the interpreter how much memory it should allocate for a variable and how to handle it. E.g 4 bytes in memory can be an integer number, or a string of 4 ASCII chars, or unicode char etc. Or, a+b, depending on a datatype can mean "concatenate strings a and b" or "add integers a and b".
0
yes I think so