There are a few different ways to use the C++ namespace. The simplest is to use it as the first argument to another function and the last argument to the function itself.
The C function name is 0x0, so this is a “namespace tcc” function. We can then use it to call another function, or to declare a variable.
The other way to use namespace is with a C preprocessor directive, which is just like a C function declaration. The namespace is specified with a colon.
The code from this video doesn’t actually do anything except call a function that returns an int. It’s simply a code snippet to show how to use a C function.
It’s worth noting that this particular example is from the video “Getting Started with C++”. The video has a few other use cases for C functions as well.
The tcc namespace is just an alias for the preprocessor function. The namespace is not actually necessary for the preprocessor to work. It’s just a shorthand for the C preprocessor function.
The preprocessor function is actually quite easy to use. Its really just a wrapper around C’s prelude function called __pldiv. The prelude function is used to build up the first argument of a C function, and the __pldiv function is used to build up any of the rest of the parameters. You can use two preprocessor function calls to get all of the parameters of a function as arguments.
I guess it seems like it’s a good way to keep the compiler from complaining about an empty header file. But at the end of the day it isn’t really necessary because it only affects how a C function looks when it is called with the right arguments.
The only way that I can think of to do this is to use a simple class library. The name of the library is something like: __libc.c, which is exactly what you would expect. The only thing you can do is to turn the library into a class.
That’s pretty much what C++ does with functions, but I don’t know if that’s how namespace tcc is doing it. It would be a shame to see such an important system (and language) go away.