Horje
Stream Overloading Code Example
Stream Overloading
// #include <bits/stdc++.h>
// #include<chrono>
// using namespace std;
// auto start = chrono::steady_clock::now();

// int main(){
//     cout<<"My name is Devil"<<endl;
//     auto end= chrono::steady_clock::now();
//     auto diff = end - start;
//     cout<<chrono::duration<double,milli>(diff).count()<<" ms"<<endl;
//     return 0;
// }

// #include <bits/stdc++.h>
// #include<chrono>
// using namespace std;
// auto start = chrono::steady_clock::now();

// int main(){
    
//     cout<<"Hello how are u Akash kumar jiii"<<endl;
//     auto end= chrono::steady_clock::now();
//     auto diff = end - start;
//     cout<<chrono::duration<double,milli>(diff).count()<<"ms"<<endl;
//     return 0;
// }

#include<bits/stdc++.h>
#include<stdexcept>
#include<chrono>
using namespace std;
auto start = chrono::steady_clock::now();

class Person{
	string name;
	int age;
	public:	
		Person(){
			this->name = "No name";
			this->age = 0;
		}
		friend ostream &operator <<(ostream &output , Person &p);
		friend istream &operator >>(istream &input , Person &p);
};

ostream &operator <<(ostream &output , Person &p){
	output<<"Who is Devil "<<endl;
	output<<"My name is "<<p.name<<" My age is "<<p.age<<endl;
	return output;
}
istream &operator >>(istream &input , Person &p){
	cin>>p.name>>p.age;
	return input;
}

int main(){
	cout<<"Enter the name "<<endl;
	Person ak;
	cin>>ak;
	cout<<ak;

    auto end= chrono::steady_clock::now();
    auto diff = end - start;
    cout<<chrono::duration<double,milli>(diff).count()<<" ms"<<endl;
}




Cpp

Related
rotation 2d d'un point Code Example rotation 2d d'un point Code Example
esp Code Example esp Code Example
query for rmq using sqrt decomposition Code Example query for rmq using sqrt decomposition Code Example
3. The method indexOf, part of the List interface, returns the index of the first occurrence of an object in a List. What does the following code fragment do? Code Example 3. The method indexOf, part of the List interface, returns the index of the first occurrence of an object in a List. What does the following code fragment do? Code Example
identity Code Example identity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8