A quick web search produced this:
Host Variable Names in C and C++
<http://keyword.netscape.com/ns/boomframe.jsp?query=length+of+variable+name+c&page=1&offset=0&result_url=redir%3Fsrc%3Dwebsearch%26requestId%3D23a2e391d240237f%26clickedItemRank%3D1%26userQuery%3Dlength%2Bof%2Bvariable%2Bname%2Bc%26clickedItemURN%3Dhttp%253A%252F%252Fpublib.boulder.ibm.com%252Finfocenter%252Fdb2help%252Ftopic%252Fcom.ibm.db2.udb.doc%252Fad%252Fc0005925.htm%26invocationType%3D-%26fromPage%3DnsBrowserRoll%26amp%3BampTest%3D1&remove_url=http%3A%2F%2Fpublib.boulder.ibm.com%2Finfocenter%2Fdb2help%2Ftopic%2Fcom.ibm.db2.udb.doc%2Fad%2Fc0005925.htm>
[New Window]
<http://publib.boulder.ibm.com/infocenter/db2help/topic/com.ibm.db2.udb.doc/ad/c0005925.htm>
Host Variable Names in C and C++. The SQL precompiler identifies host
variables by their declared ... Specify variable names up to 255
characters in length.
Verified by a Netscape Security Partner: Netscape Security Center,
VeriSign, TRUSTe
http://publib.boulder.ibm.com/infocenter/db2help/topic/com.ibm.db2.udb.doc/ad/c0005925.htm
.
Pretty much everything has a limit, either imposed by the software or by
the environment. Binary multiples are the most common - 16, 32, 64,
128, 256 (each less 1) often are max points since programming languages
use binary deep down. So, 256 less 1 = 255 in this case. 32768 less 1
= 32767, your value example. The environment limits include memory
capacity and hard drive space.
Paul Hachmeyer
Pace University, NYC
Frederick Navarro wrote:
> I was asked by my nephew with such a silly question, but from an innocent
> mind, for me, its quite valid. He is studying C programming language
> and
> for members here who are programmers, maybe I could ask any of your
> input on
> this question. The question is,
>
> Does C or C++ have a limit/max capacity of the number of characters to be
> used for its variable name? Take note, he is referring the variable
> name,
> not the max value of the data type. For example, *"int My_Number"*
> declares
> My_Number to be of integer data type which can hold values between
> -32767 to
> +32766 more or less only. But his question is for the variable name,
> which
> I just answered that it doesn't make any sense making a variable name
> say,
> with more than 50 characters. He simply said, "Yeah, I understand. But
> just for the sake of information, is there such a limit?". And this
> time I
> was left hanging. Thanks for your thoughts.
>
>
> Frederick Navarro
PCSOFT maintains many useful files for download
visit our download web page at:
http://freepctech.com/downloads.shtml
|