Tag Archives: programming

failable initialiser swift simple example

failable initialiser swift simple example In swift, Failable initialisers are used with structure,class and enumeration. When it is not sure that a property within class or structure or enumeration will be initialised then failable initialisers are used. For this, we write initialiser with init? syntax and if initialisation succeeds then value is assigned or else… Read More »

init method simple example swift programming

init method simple example swift programming Example below shows use of init method. It is used for initialization of the structure,class or enumeration property. In swift, we must initialise the properties before using them. So either you can do it while declaring them if they are not going to change for all instances. In case,… Read More »

int argc, char** argv meaning in C++

int argc, char** argv meaning in C++ argc and argv are how command line arguments are passed to main() in C and C++.  argc will be the number of strings pointed to by argv. This will (in practice) be 1 plus the number of arguments, as virtually all implementations will prepend the name of the… Read More »

What are namespaces in C++ ?

What are namespaces in C++ ? Consider a situation, when we have two persons with the same name, Steve, in the same class. Whenever we need to differentiate them definitely we would have to use some additional information along with their name, like either the area if they live in different area or their mother… Read More »