What is "namespace SoloLearn". Why is it used. | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

What is "namespace SoloLearn". Why is it used.

In C++ I saw "using namespace standard" didn't understood even then.

20th Aug 2016, 6:45 PM
Probir Singha
Probir Singha - avatar
3 Respuestas
+ 4
it's a convention, you can name it as you Want. It is used to work with many scripts: if you had already wrote a script, and this script has many variables or functions that you need in your new script, you can just import everything without the need to re-write every single variable or function. If your namespace is LoL, just add "using LoL" at the begining of your new script. Now We you can use variables,functions and classes of the LoL script in your new script. Supposing in the LoL script there is a function called Hello, you Want to call this function in your new script, you have to do this: LoL.Hello() #remember to ad the "using LoL" at the beginning
21st Aug 2016, 5:21 PM
Marco Romanin
Marco Romanin - avatar
+ 1
Thanks a lot.
21st Aug 2016, 5:54 PM
Probir Singha
Probir Singha - avatar
0
Best
24th Oct 2016, 2:38 AM
HD Channel5
HD Channel5 - avatar