STL: accessing a list across files

Started by
1 comment, last by ZoomBoy 20 years, 11 months ago
In STL Pretty basic but how do I address a list across different cpp files? in PCEdit.cpp I would have std::list WeaponList; How would I access it in another cpp file? Would I use a reference in an .h file? ZoomBoy Developing a iso-tile 2D RPG with skills, weapons, and adventure. See my old Hex-Tile RPG GAME, character editor, diary, 3D Art resources at Check out my web-site
Advertisement
do it the same way you would with any other type of data
If you are using globals use the extern keyword.

[How To Ask Questions|STL Programmer''s Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]
Arguing on the internet is like running in the Special Olympics: Even if you win, you're still retarded.[How To Ask Questions|STL Programmer's Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]

This topic is closed to new replies.

Advertisement