J
Jason20005
Dear all,
Why C and some of other languages dont allow the name of a variable
start with a digit?
Why C and some of other languages dont allow the name of a variable
start with a digit?
Richard Heathfield said:Jason20005 said:
Assume C *did* allow it. What should the output of this program be?
#include <stdio.h>
int main(void)
{
int 42 = 6;
printf("%d\n", 42);
return 0;
}
What should be printed, and why?
Jason20005 said:
Assume C *did* allow it. What should the output of this program be?
#include <stdio.h>
int main(void)
{
int 42 = 6;
printf("%d\n", 42);
return 0;
}
What should be printed, and why?
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Richard said:Jason20005 said:
Assume C *did* allow it. What should the output of this program be?
#include <stdio.h>
int main(void)
{
int 42 = 6;
printf("%d\n", 42);
return 0;
}
What should be printed, and why?
Jason20005 said:Dear all,
Why C and some of other languages dont allow the name of a variable
start with a digit?
More useful (to me anyway) would have been the ability to use $ in an
identifier
Jason20005 said:
Assume C *did* allow it. What should the output of this program be?
#include <stdio.h>
int main(void)
{
int 42 = 6;
Still does allow it. So does VaxC if I recall correctly.
--
Mark McIntyre said:Still does allow it. So does VaxC if I recall correctly.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.