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 »

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 »

What is .cpp file ?

What is .cpp file ? A file name with extension .cpp is a file that contains the source code written in the C++ (CPP – C plus plus) computer programming language. CPP file is one of the file from the many files in a C++ project and when all of them are compiled together, CPP creates… Read More »