Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
EqualIdentical
//g++ 7.4.0 //this code is created by Rezaul Hoque on March 11,2022;contact: jewelmrh@yahoo.com,Dhaka, Bangladesh //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <iostream> using namespace std; //to see whether two variables have same value template <class T> bool is_equal (T a, T b) { return (a==b); } //to see whether two variables hold same adress template <class T> bool is_identical (T a, T b) { return (&a == &b); } int main () { int a= 5; int d=a; cout<<"Address of a: "<<&a<<"\n"; cout<<"Address of d: "<<&d<<"\n"; if (is_equal(a,d)) cout << "a and d are equal\n"; else cout << "a and d are not equal\n"; if (is_identical(a,d)) cout << "a and d are identical\n"; else cout << "a and d are not identical\n"; return 0; }
run
|
edit
|
history
|
help
0
Operators
Scope guarding
Polyrmophism
TempQuickDoubly
CountingSort
anagram
my template
Zahra_matrix
SpiralMatrix
kickstartd