+ 1

How can I define and declare a variable in separated files? (C++)

How can I define a variable on (example): sample.h and declare it on sample.cpp?

17th Jul 2018, 8:50 PM
Dror Dahari
Dror Dahari - avatar
3 ответов
+ 2
You can declare it in the header and change the value. use a struct or class and intialize with the desired value. https://www.sololearn.com/learn/2917/?ref=app
17th Jul 2018, 9:00 PM
Manual
Manual - avatar
+ 2
Dror Dahari You're welcome!😀
17th Jul 2018, 9:06 PM
Manual
Manual - avatar
+ 1
Thanks!
17th Jul 2018, 9:02 PM
Dror Dahari
Dror Dahari - avatar