asignment in class

R

Raptor

Is it right, that you cannot assign any value to a variable in a
class, which is not static?
 
V

Victor Bazarov

Raptor said:
Is it right, that you cannot assign any value to a variable in a
class, which is not static?

You cannot *initialise* it there, yes. And for statics you can only
initialise it if it's of integral type.

And have some patience, there is no need to post twice. This is not
a chat room or an IRC channel.

V
 
B

Bill97

Raptor said:
Is it right, that you cannot assign any value to a variable in a
class, which is not static?

I guess literally that's true. Usually you assign values to non-variable
variables within objects. The notion of assigning a variable to a whole
class seems to presuppose this it is static.
 
B

Bill97

Bill97 said:
I guess literally that's true. Usually you assign values to non-variable
variables within objects. The notion of assigning a variable to a whole
class seems to presuppose this it is static. I guess literally that's
true.

Sorry about my typo. I meant to type:

Usually you assign values to non-static variables within objects. The notion
of assigning a variable to a whole
class seems to presuppose this it is static.
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top