+ 1

What is the difference between const and static in c++?

c++

20th Jan 2018, 6:27 PM
Amit Pokhrel
2 Answers
+ 3
you can have multipleĀ staticĀ variables in differentĀ c++Ā source code files with the same name and no name conflicts.constĀ is justĀ constant, meaning can't be modified. AĀ staticĀ variable can get an initial value only one time. ... As such,Ā staticĀ variables are only initialized once. -stackoverflow
20th Jan 2018, 6:35 PM
emmey
emmey - avatar