XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).
Moderator: General Moderators
MarK (CZ)
Forum Contributor
Posts: 239 Joined: Tue Apr 13, 2004 12:51 am
Location: Prague (CZ) / Vienna (A)
Contact:
Post
by MarK (CZ) » Sat Oct 01, 2005 3:49 pm
Hi,
I started learning C++ some time ago and now - since I'm addicted to PHP
- I wonder whether it's okay to use dollar sign ('$') as a perfix for variables. It seems to work but I'd like to know whether it is an acceptable practice..?
Thanks in advance
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Oct 01, 2005 4:07 pm
$ is not a valid identifier character in C
Skara
Forum Regular
Posts: 703 Joined: Sat Mar 12, 2005 7:13 pm
Location: US
Post
by Skara » Wed Oct 05, 2005 12:30 pm
i.e. forget $ ever existed when working in C/C++. It has nothing to do with anything.
Ree
Forum Regular
Posts: 592 Joined: Fri Jun 10, 2005 1:43 am
Location: LT
Post
by Ree » Wed Oct 05, 2005 12:54 pm
yeah, $var would look weird in C++
Ambush Commander
DevNet Master
Posts: 3698 Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US
Post
by Ambush Commander » Wed Oct 05, 2005 3:42 pm
It does work, but most compilers by default won't accept it. It's usually used for machine generated code.