பெயர்வெளி

கட்டற்ற கலைக்களஞ்சியமான விக்கிப்பீடியாவில் இருந்து.

பெரிய மென்பொருள்களில் நூற்றுக்கணக்கான இனங்காட்டிகள் பயன்படுத்தப்படலாம். தொடர்புள்ள இனங்காட்டிகளை கொத்தாக சேர்கப்பட்டு சுட்டப்படும் வெளியே பெயர்வெளியாகும். அதாவது ஒரு பெயர்வளியில் இனக்காட்டிகள் தொகுக்கப்பட்டிருக்கும். அந்த பெயர்வெளியை சுட்டுவதன் மூலம் அந்தா இனங்காட்டிகளைப் பயன்படுத்தலாம். இந்த செயற்பாடு மொழியின் பகுதிக்கூறு (modular) கட்டமைப்பைப் பலப்படுத்துகின்றது.

சி++[தொகு]

In சி++, a namespace is defined with a namespace block.

namespace foo {
  int bar;
}

Within this block, identifiers can be used exactly as they are declared. Outside of this block, the namespace specifier must be prefixed. For example, outside of namespace foo, bar must be written foo::bar. C++ includes another construct that makes this verbosity unnecessary. By adding the line

using namespace foo;

to a piece of code, the prefix foo:: is no longer needed.

"https://ta.wikipedia.org/w/index.php?title=பெயர்வெளி&oldid=3073494" இலிருந்து மீள்விக்கப்பட்டது