I can only see a single question of yours that is downvoted, I presume the others are deleted, so I cannot tell you how to improve them.
Regarding the question you linked, here is what I think could be improved:
I tried to access variables within a class with a single period
between the object name and the variable, then I remembered that the
variables were private, so I modified the code to this:
Your question starts pretty much "in medias res". It is not clear how this information is even relevant to your subsequent question.
I got this error from the compiler:
When showing a compiler error, always mark the line at which the error occurs. Otherwise every reader has to either copy your code and compile it themselves, or parse each line in their head until they find one that could possibly cause this error. Both can be very annoying.
Why is the compiler saying that t is not a member?
Here is the crux of this question, the previous points are minor compared to this:
The compiler is giving you a pretty clear error message. Why do you think that t is a member of Test?
Or put another way: why do you think Test::t.rtest
is a valid way to access a private member of t?
Here is where you can show your research effort. If you for example write: "In chapter 2. of the c++ syntax reference at [link xy] it is claimed that this is the correct syntax for accessing private members", or "In [this] related answer on stackoverflow, this syntax is used without problems", or anything else that shows how you arrived at the conclusion that your code should work; then a reader can follow your thoughts and tell you where you went wrong.
If this part is missing, some may assume that you did not research this at all, and downvote accordingly, especially when the question appears obvious.
Note that in the process of writing down your research, the solution often becomes apparent by itself; i.e. when checking which part of your c++ syntax reference said that private members can be accessed by xy::
, you see that this actually referred to static members, or something similar.
That is an intended side-effects. The questions that remain unsolved after this step are usually the interesting ones.
One aspect that you did quite well in your question: you provided a mcve, your code is compact and quick to read. So there is that.
I think some of the downvotes you received were caused by the raised attention the question received by being linked from your meta question, and if so, that is a bit of a shame. But don't let that discourage you from asking how to improve your questions.