Computing.Net > Forums > Programming > Variable declaration

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Variable declaration

Reply to Message Icon

Name: Val
Date: October 1, 2002 at 04:54:14 Pacific
OS: windows 2000
CPU/Ram: I don't know
Comment:

How do I need to declaire variable in one class so other classes will see it.
Thank you



Sponsored Link
Ads by Google

Response Number 1
Name: cup
Date: October 1, 2002 at 07:42:41 Pacific
Reply:

Put it in the public section.
eg

class Transparent
{
public:
int visible;
};

class Ogle
{
public:
void Binoculars (Transparent* glass)
{

glass->visible = 200

}
}


0

Response Number 2
Name: Val
Date: October 2, 2002 at 04:36:22 Pacific
Reply:

Thank you. I did that. I can see my variable in another class but not it's value. By the way I am programming in VB6


0

Response Number 3
Name: brody
Date: October 2, 2002 at 15:19:52 Pacific
Reply:

place a public variable in the declarations i.e at the top before anything else.

Public iInt as integer

It's always worked for me.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Creating a Property Contr... java program help



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Variable declaration

Variable declarations in C www.computing.net/answers/programming/variable-declarations-in-c-/11181.html

Arrays in C-variable declaration??? www.computing.net/answers/programming/arrays-in-cvariable-declaration/8666.html

Declaring global variables in VB www.computing.net/answers/programming/declaring-global-variables-in-vb/9336.html