assign number to variable name
-
but if i enum ?? enum(1a,2a,3a,4a,5a)
nemanja
Enum members are not variables, and even those identifier cannot start with a number. Had you tried it yourself, you would have found out quite easily. But, in either case, you still lose...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
my teacher is one peace of shit ... im 92' and i am programming 5 years now and he teaches me whats a computer .. how to switch it off , on, het yells to me when i am not listening him .... and this question is for Pascal but i havent found pascal forum ... we learn pasacl becaues my teacher is 65 years old and dont know anything other .... i won 3 bets allready from him!!!!
nemanja
My sympathys are with your teacher. You don't listen to him, and you still haven't learned your lesson.
conemajstor wrote:
won 3 bets allready from him
But not this one.
Deja View - the feeling that you've seen this post before.
-
my teacher is one peace of shit ... im 92' and i am programming 5 years now and he teaches me whats a computer .. how to switch it off , on, het yells to me when i am not listening him .... and this question is for Pascal but i havent found pascal forum ... we learn pasacl becaues my teacher is 65 years old and dont know anything other .... i won 3 bets allready from him!!!!
nemanja
conemajstor wrote:
im 92'
You are ninety-two feet? Or did you perhaps mean '92? ;)
conemajstor wrote:
i am programming 5 years now
Oh, a newbie. ;)
conemajstor wrote:
het yells to me when i am not listening him
Go figure...
conemajstor wrote:
we learn pasacl
That's good. Pascal is an excellent language for learning programming.
conemajstor wrote:
becaues my teacher is 65 years old and dont know anything other
I seriously doubt that.
conemajstor wrote:
i won 3 bets allready from him
So now you think that you know anything? ;)
--- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams
-
conemajstor wrote:
im 92'
You are ninety-two feet? Or did you perhaps mean '92? ;)
conemajstor wrote:
i am programming 5 years now
Oh, a newbie. ;)
conemajstor wrote:
het yells to me when i am not listening him
Go figure...
conemajstor wrote:
we learn pasacl
That's good. Pascal is an excellent language for learning programming.
conemajstor wrote:
becaues my teacher is 65 years old and dont know anything other
I seriously doubt that.
conemajstor wrote:
i won 3 bets allready from him
So now you think that you know anything? ;)
--- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams
-
conemajstor wrote:
I bet with the teacher
Do you have a gambling problem? That's like betting on a three legged dog!
10 bucks says it falls down!
Ninja (the Nerd)
Confused? You will be... -
Is it possible to assign number to variable name to fisrst place example : string 5cake="Good"; int 1name= 1; I bet with the teacher that this is possible so please dont dissapoint me ...:D:D:D Regards Nemanja
nemanja
You could always... cheat. Fonts, all they are a little pictures really. What is it, courier new that compilers mostly use? Anyway, see if you can get yourself that font, edit out some symbol that is allowed, and make it a number. To the user, the first letter in the variable name is a number, but to the compiler its just a symbol, or another letter. Oh, by the way, cheating is bad. Don't do it ;)
My current favourite word is: Waffle Cheese is still good though.
-
conemajstor wrote:
are you kididng
Why would I be kididng [sic]? You asked whether variables names that begin with a number are valid. I suggested that you tried it and observed what happened. You tried it and found that it didn't work. By following an empirical approach, you have answered your own question.
conemajstor wrote:
it must be some way to compile it like working with bits and bytes ore such ... or some lists,arrays, ....
This sentence is nonsense. I have no idea what you are talking about.
Paul Marfleet
-
conemajstor wrote:
I bet with the teacher that this is possible
You lose. Not even with the @ identifier specifier does it work:
int @int = 1; // Works just fine. int @1name = 1; // Nope.
An identifier in C# can never ever start with a digit.--- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams
Guffa wrote:
An identifier in C# can never ever start with a digit.
Bonus question: can identifier start with digit in IL? (I gave up after maybe 2 min. of googling :O)
[My Blog]
"Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe -
my teacher is one peace of shit ... im 92' and i am programming 5 years now and he teaches me whats a computer .. how to switch it off , on, het yells to me when i am not listening him .... and this question is for Pascal but i havent found pascal forum ... we learn pasacl becaues my teacher is 65 years old and dont know anything other .... i won 3 bets allready from him!!!!
nemanja
You really need to listen. If he's your teacher, he's better than you. Usually, but now, duh. Period.
The most knowledge doesn't mean the most wise...
-
my teacher is one peace of shit ... im 92' and i am programming 5 years now and he teaches me whats a computer .. how to switch it off , on, het yells to me when i am not listening him .... and this question is for Pascal but i havent found pascal forum ... we learn pasacl becaues my teacher is 65 years old and dont know anything other .... i won 3 bets allready from him!!!!
nemanja
> .... and this question is for Pascal but i havent found pascal forum ... Sorry, but it's not valid in Pascal, either. (unless you use the font-edit method below) Thomas Bates I want to live in Theory. Everything works in Theory.