0

i want to to able to access to a class's vairable but this varible is not declared class's header file
it is in the cpp file i couldn't write a method that acces to it because methods cannot access it(since the variable is not in the header file) how can i solve this problem

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by WaltP
0

The only way you could possibly access it is if the variable is global and non-static. In that case you could declare it with the extern keyword in your program. If your program links then you should be ok. If it doesn't link, then tough luck, you will not be able to access it.

0

i want to to able to access to a class's vairable but this varible is not declared class's header file
it is in the cpp file i couldn't write a method that acces to it because methods cannot access it(since the variable is not in the header file) how can i solve this problem

I don't know what your native language is, but in English we have things like periods (.) to end a sentence so you can communicate effectively. Try using them, please. Oh, and that was a comma (,) -- also useful.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.