Author |
Topic |
|
sitnduck
Senior Member
47 Posts |
Posted - Jul 22 2024 : 08:30:59 AM
|
When I create a global variable in a CPP file, it would be nice to be able to generate an "extern" in the header file, e.g.:
CPP int g_iMyGlobal = 0;
H extern int g_iMyGlobal;
Apologies if this exists and I missed it! |
|
feline
Whole Tomato Software
United Kingdom
19078 Posts |
Posted - Jul 23 2024 : 08:34:25 AM
|
I don't know of any command for this, so I don't think you have missed one
How would VA know you are planning on making this an extern? Or just offer the option on any file scope variable in a cpp file? Since being a file scope, so "global" variable doesn't mean its an extern variable, not something we would want to try to do automatically. |
zen is the art of being at one with the two'ness |
|
|
sitnduck
Senior Member
47 Posts |
Posted - Aug 14 2024 : 07:53:09 AM
|
Yes, something like that, it's very similar to "Quick actions and re-factoring->Create Declaration". It would be an added "->Create Extern Declaration", and generates that line in the header.
Thank you! |
|
|
feline
Whole Tomato Software
United Kingdom
19078 Posts |
Posted - Aug 14 2024 : 11:00:07 AM
|
That makes sense, and I just wanted to make sure that I understood what you were thinking properly here I have put in a feature request for this:
case=164869 |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|