probably not. first the syntax is likely wrong for C++ and if you had it correctly and inside a function, the instance would be scoped to the function and be deleted the minute you leave the function. Global variables will have a lifetime matching the duration of the code
Nothing similar.
The PubSubClient and WiFiClient are the data types, while the g_WiFiClient and g_mqttPubSub are the variables of these types. It is a completely different things.
As an example, below is a code, illustrates working with variables:
int x;
int y;
int z;
z = x + y;
and what you suggested to write instead it:
(int) = (int) + (int);
It is not the same as first code, this code won't compile and, in general, it is complete non-sense.
what you said would have made sense if those were #define, ie textual substitution at compile time. but here it's not just that. It's two real variables being allocated and then used
ah weird - I did click reply on the first post from @m4biz usually it would have a link to that post - may be it does not work when it's the first one?
ah weird - I did click reply on the first post from @m4biz usually it would have a link to that post - may be it does not work when it's the first one?
(testing with replying to you)
so when clicking reply (under the post) within the thread it seems to work but not for the original post... weird