C++ Templates: Templates with Multiple Parameters | C++ Tutorials for Beginners #65

preview_player
Показать описание
Learning C++ templates is a must for competitive programming. If you are watching this C++ course in Hindi, this is the C++ template tutorial which will be most beneficial if you want to get into competitive programming and level up your C++ learning

Best Hindi Videos For Learning Programming:

►C Language Complete Course In Hindi -

►JavaScript Complete Course In Hindi -

►Django Complete Course In Hindi -

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

Here's an example :

#include<iostream>
#include<string>
using namespace std;

static int counter = 1;

template<class A, class B, class C>
class Student{
A roll_no;
B name;
C cgpa;
public:
Student(A x, B y, C z){
roll_no = x;
name = y;
cgpa = z;
}
void display(void){
cout << "\nSTUDENT - " << counter << endl;
cout << "Roll Number : " << roll_no << endl;
cout << "Name : " << name << endl;
cout << "CGPA : " << cgpa << endl;
counter++;
}
};

int main(){
Student<int, string, float> s1(95, "Abhik", 94.75);
s1.display();

Student<int, string, float> s2(98, "Roshan", 81.50);
s2.display();

return 0;
}

abhikgupta
Автор

Vector example is more harder to understand than Template concept😂😂

devangvaishnav
Автор

Harry Bhai aap jabaardast ho bhai, you are the only youtuber who has a full comprehensive c++ playlist Love you bhai

TiQTECH
Автор

Did anyone imagined the level of flexibility template offers us, when Harry told, " You can even pass 'class' as a data type".

rohanchavan
Автор

9:10
.
.
#include <iostream>
using namespace std;

// Explains Templates with Multiple Parameters

template <class T1, class T2>
class multiply
{
T1 a;
T2 b;

public:
multiply()
{
cout << "Enter Two Nos-> ";
cin >> a >> b;
}
int display()
{
cout << "\nMultiplication of two nos is = " << this->a * b;
}
};

int main()
{
multiply<float, float> A; // here any data type can be used to get the required output
A.display();
return 0;
}

jatingorana
Автор

Harry bhai plz ap projects pr video banaiye like as- whats app, instagram, facebook, telegram, amazon, flipcart.. taki hum sab students ko 1 idea mil paaye ki ye sab badi 2 app or ye website kaise develope hoti h ...ye sab me apse isiliye bol rha hu kunki ap bhut ache se apne har video m define krte ho jo hme easily smjh m a jate ...

vidyasagar
Автор

Harry bhai you taught in very fantastic way. Please make 3d game devolopement playlist. I am waiting so eagerly.

XAAbhayDarade
Автор

note: agar aap char function ka istamal karke koi integer dalte ho to aapko error ki jagah pe koi bhi emoji dekhne ko milega.
only on this video 👆
please try it.

sahilradadiya
Автор

Aap iss course me C++17, C++20 features bhi discuss karoge kya?

rahulsingh-cbok
Автор

Sir I am a 7th grade student and you have changed my life first I was a game addict and when I watched your videos now am making games thank you sir now I am making projects because of you Thank you sir .

aashaktsharma
Автор

In your VS code what's that icon present under the extension icon 🤔 .... Not present in own IDE ?

bhupeshpattanaik
Автор

If someone watch your video from beginning.so there is no problem for understanding this concept

SyedaRida-E-Fatima-mxvt
Автор

Thanks for that beautiful explanation . I request you to upload notes and code on your website. That would be help for us.

shekharsingh
Автор

At 2:22 Why harry used 'this' function in line no 16 instead of writing a Normal cout function .

tejasthombare
Автор

C++ Tutorials In Hindi
C++ Templates: Templates with Multiple Parameters | C++ Tutorials for Beginners #65

Papaplayer
Автор

Thanks a lot for properly explaining the concept

rudrasarkar
Автор

#include<iostream>
using namespace std;
//CLASS TEMPLATES WITH MULTIPLE COMMA SEPARATED PARAMETERS
template <class T1, class T2>
class employee{
public:
T1 ID;
T2 name;
employee(T1 a, T2 b){
ID=a;
name=b;
}
void display(){
// cout<<"the ID of the employee is "<<ID<<endl;
// cout<<"the name of the employee starts with "<<name<<endl;
cout<<
}

};
int main(){
employee<int, char> keya(4535, 'n');
keya.display();
return 0;
}

nupoorsagar
Автор

Harry bhai, Website pe 60 tutorial hi hai vaha add kardo baaki ke easy ho jata hai access karna

roshanshaikh
Автор

Make a series of....qt creator with python

anik
Автор

Bro, mein aapki puri C++ series follow kar raha hun par hackerrank ke C++ ke questions nahi ho pah rahe....please make a video regarding question practice of C++.

AtulKumar-sqiw