Created at 4am, Jan 7
cyranodbSoftware Development
1
Object Oriented Programming Using C++
6ExcsTqXzu2eVn_f4uA0nI3GuFqofkLGFGWFUlICynY
File Type
PDF
Entry Count
191
Embed. Model
jina_embeddings_v2_base_en
Index Type
hnsw

Introduction to object oriented programming, user defined types, structures, unions, polymorphism, encapsulation. Getting started with C++ syntax, data-type, variables, strings, functions, default values in functions, recursion, namespaces, operators, flow control, arrays and pointers.

LECTURE NOTES ON Object Oriented Programming Using C++

Prepared by Dr. Subasish Mohapatra

But, those overloaded by means of a friend function take one reference argument (the object of the relevant class). Binary operators overloaded through a member function take one explicit argument and those which are overloaded through a friend function take two explicit arguments. Table 7.2 Arguments passed to the Member Function No 1 Operator to Overload Unary Operator Binary Operator Arguments passed to the Friend Function 1 2 LECTURE-24
id: 8e2fec8b409dcf1aa1bca0db2168d078 - page: 76
Type Conversions In a mixed expression constants and variables are of different data types. The assignment operations causes automatic type conversion between the operand as per certain rules. The type of data to the right of an assignment operator is automatically converted to the data type of variable on the left. Consider the following example: int x; float y = 20.123; x=y ; This converts float variable y to an integer before its value assigned to x. The type conversion is automatic as far as data types involved are built in types. We can also use the assignment operator in case of objects to copy values of all data members of right hand object to the object on left hand. The objects in this case are of same data type. But of objects are of different data types we must apply conversion rules for assignment. There are three types of situations that arise where data conversion are between incompatible types. 1. 2. 3.
id: caa7b32809bd15a05222ab5dd7911509 - page: 77
Conversion from built in type to class type. Conversion from class type to built in type. Conversion from one class type to another. Basic to Class Type A constructor was used to build a matrix object from an int type array. Similarly, we used another constructor to build a string type object from a char* type variable. In these examples constructors performed a defacto type conversion from the argument's type to the constructor's class type Consider the following constructor: string :: string (char*a) { length = strlen (a); name=new char[len+1]; strcpy (name,a); } This constructor builds a string type object from a char* type variable a. The variables length and name are data members of the class string. Once you define the constructor in the class string, it can be used for conversion from char* type to string type. Example string si , s2; char* namel = Good Morning; char* name2 = STUDENTS ; s1 = string(namel); s2 = name2; The program statement
id: 2723b3f60bbf34bbbe91b0fa565ab2d8 - page: 77
The statement s2 = name2; performs the same job by invoking the constructor implicitly. Consider the following example class time { int hours; int minutes; public: time (int t) // constructor { hours = t / 60; minutes = t % 60; } //t is inputted in minutes }; In the following conversion statements : time Tl; int period = 160; Tl = period; //object Tl created
id: e49dc653651dbb7609d86ca703f83378 - page: 78
How to Retrieve?
# Search

curl -X POST "https://search.dria.co/hnsw/search" \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"rerank": true, "top_n": 10, "contract_id": "6ExcsTqXzu2eVn_f4uA0nI3GuFqofkLGFGWFUlICynY", "query": "What is alexanDRIA library?"}'
        
# Query

curl -X POST "https://search.dria.co/hnsw/query" \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"vector": [0.123, 0.5236], "top_n": 10, "contract_id": "6ExcsTqXzu2eVn_f4uA0nI3GuFqofkLGFGWFUlICynY", "level": 2}'