Class Templates in C++ with Program Example | C++ Programmming

  Рет қаралды 149,533

Simple Snippets

Simple Snippets

Күн бұрын

Пікірлер: 134
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Hey Guys, if you want more such tech educational videos on this channel then please support me by subscribing to this channel & also share it with your friends as it helps me create more content just for you ✌
@rajveerbhai7624
@rajveerbhai7624 Жыл бұрын
Wow I just discovered this channel. And I really like your way of teaching. It's helps me so much. Thank you
@SimpleSnippets
@SimpleSnippets Жыл бұрын
Very happy to know this Rajveer! Keep growing and learning 😊
@irshadwahab
@irshadwahab 4 жыл бұрын
Your style is excellent! Simple examples and to the point, easy to understand and the 2x speed means, not boring!! You are a good teacher! Great work!!
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Awesome, thank you!
@Mahamudul_Hasan0
@Mahamudul_Hasan0 Жыл бұрын
@@SimpleSnippets where i can find the code ?
@adisingh9341
@adisingh9341 3 жыл бұрын
Bro no kidding , I'm absolutely in complete awe to see you explained everything that there is to templates in such a short vid .
@dereksisco4790
@dereksisco4790 3 жыл бұрын
Yeah but you have to play the video at 50% to catch half of what he's saying in some parts.
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Sorry for the speed Derek. I've reduced my speed in recent videos by taking all your constructive feedback. It has helped me & our channel improve 👍😊
@sciencesosimple2418
@sciencesosimple2418 3 жыл бұрын
Yes u r right
@SK-wr3ww
@SK-wr3ww 3 жыл бұрын
@@dereksisco4790 I watch all of his videos at 1.5x speed lol
@devrao3537
@devrao3537 3 жыл бұрын
@@dereksisco4790 I watch his vids at 2x LMAO... Prolly cuz I'm used to his accent
@saga1658
@saga1658 4 жыл бұрын
the way you represent and teach is too good
@michaelhernandez2075
@michaelhernandez2075 3 жыл бұрын
Holy fucking hell thank you for the clear and concise tutorial. I have been watching shit from like 10 years ago that wasn't helping me what so ever. thank you.
@nirajmalik0910
@nirajmalik0910 2 жыл бұрын
Stacks is LIFO That means Last In First Out (LIFO)
@sauravdutta99
@sauravdutta99 4 жыл бұрын
template is used for-1.memory space 2.programming language 3.variable value 4.variable address
@44mod
@44mod 5 жыл бұрын
You do a great job I can follow your videos easily. Thank you!
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thank you so much bro 😊 means a lot to me. I would request you to please share the video with your friends too ✌️
@haripriyap3701
@haripriyap3701 6 жыл бұрын
The channel which i loved😍😍no need of any other class..
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thank you so much buddy 😇 I'm so happy that you like this video and this channel. Please do share the videos and channel with your friends and contacts. That will be the best help you can give our channel 😇 ✌️
@Satvikshukla0007
@Satvikshukla0007 2 жыл бұрын
was struggling to get this concept, you made it really easy, thanks.
@deepikaarora8125
@deepikaarora8125 3 жыл бұрын
you are a great teacher i subscribed you in single video too good...thank you so much
@i_write7500
@i_write7500 Жыл бұрын
How did you make it so Simple❤️ Its really helpful! Thank you very much🌟
@SimpleSnippets
@SimpleSnippets Жыл бұрын
You're welcome 😊
@imankhalid3191
@imankhalid3191 3 жыл бұрын
You're a lifesaver for sure.
@aswinmanmathans6837
@aswinmanmathans6837 2 жыл бұрын
is it necessary to pass the data type like etc..i did watch some lectures w/o that
@yashdongre1752
@yashdongre1752 3 жыл бұрын
Nicely Explained then all other KZbinrs Thanks:)
@saumyayadav8596
@saumyayadav8596 6 жыл бұрын
Your videos are the best . Please keep uploading them.
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thank you so much Saumya 😊 happy to hear this from you. Surely will keep uploading more content. ✌️ I would request you to please share the video with your friends too 😊✌️
@AsadKhan-yx5gg
@AsadKhan-yx5gg 3 жыл бұрын
Thanks you are good teacher 👍👍
@jamesnash9675
@jamesnash9675 2 жыл бұрын
you are the best.........masum
@shashimohansingh140
@shashimohansingh140 3 жыл бұрын
Thanks sir, through your explaination I understand it very easily.
@LeelosAdventure
@LeelosAdventure 2 жыл бұрын
very helpful thank you
@jamesnash9675
@jamesnash9675 2 жыл бұрын
you are the best................masum
@iliyafathma8325
@iliyafathma8325 2 жыл бұрын
Thank you so much for these videos it is really helpful and most importantly your explanation is simple and to the point which makes it easier to understand 😊😁
@insanegamer5275
@insanegamer5275 2 жыл бұрын
best of the best
@siddharthdhingra3627
@siddharthdhingra3627 2 жыл бұрын
Very goog video! Keep it up!!!
@sethji3950
@sethji3950 5 жыл бұрын
Conceptual videos, I liked it bro 😎...
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thank you so much buddy, Please do share this video with your friends too. Thats the biggest help and support 🙂
@harounlouati6602
@harounlouati6602 2 жыл бұрын
Well explained, thank you so much.
@shubhamsonawane967
@shubhamsonawane967 3 жыл бұрын
Sir plz add videos on c++ STL
@abhimanyualtekar7060
@abhimanyualtekar7060 4 жыл бұрын
I am trying to write function IIF(Condition, TruePart, FalsePart) like VB, Clipper/ FoxPro , TruePart and FalsePart can be float* (array) or just float, also TruPart & FalsePart can be Null. When all arguments/parameters are scalars (numbers) then resulting value is also a scalar (number). When any of arguments is an float array (array pointer) then function needs to return an array pointer. This is the most important part. The Condition is Expression Like- 1) ArrayA > ArrayB 2) floatX > floatY ?, ArrayX < 10 . . Comparison of scalar type parameters is very with (x == y ? a : b) But for float * (array pointer) each element of array is to be checked for TruePartArray & FalsePartArray These are some examples IIF(arrayA > ArrayB, ArrayX , ArrayZ) IIF (ArrayA > 10, ArrayX, Null) // resulting array will be added with all Null(s) as FalsePart IIF(ArrayX == FloatA, ArrayA, ArrayB) IIF( FlatA >= FloaB, ArrayX, Array) Condition is an expression so that is to be handled separately for Operator parsing and operator can be passed as string. in that case it will be a function of 5 parameters i.e. IIF( ArrayX, "==",ArrayZ, ArrayA, Null) or IIF( floatX, ">=", floatY, floatC, Null) Pl Let me know How to write Function Templet where Parameters can be float, float* or Null ?
@levi25902
@levi25902 2 жыл бұрын
Thank You so much,ur vids help sm
@devrao3537
@devrao3537 3 жыл бұрын
Bhai tu sahi mein bahgwan ho!
@oleksandrbondarenko9431
@oleksandrbondarenko9431 3 жыл бұрын
You helped me, thanks
@MuzzySquared
@MuzzySquared 2 жыл бұрын
Very useful indeed.
@somnathmore1082
@somnathmore1082 3 жыл бұрын
Video no I watched on simple snippets:19
@zakriabacha2477
@zakriabacha2477 6 жыл бұрын
excellent sir.
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thank you so much buddy. Really happy to see your positive feedback 😋
@gubbu8352
@gubbu8352 3 жыл бұрын
Tottaly i didn't understand but i understand something 👍
@tetlleyplus
@tetlleyplus 4 жыл бұрын
Awesome! you rock!
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Thanks! You too!
@summayyahashmani2494
@summayyahashmani2494 4 жыл бұрын
Sir a doubt. In my textbook the template defination goes like : template And u wrote typename What are these and do they make any difference???
@manojseenivasan8854
@manojseenivasan8854 4 жыл бұрын
typename is nothing but a class
@debeshroy9632
@debeshroy9632 4 жыл бұрын
Same..but in new cpp version we should use class as typename will become obsolate
@zainulkhan8381
@zainulkhan8381 4 жыл бұрын
We can use both
@zainulkhan8381
@zainulkhan8381 4 жыл бұрын
Either use typename T or class T
@hehexd2913
@hehexd2913 4 жыл бұрын
@@debeshroy9632 typename will not become obsolete, its better to use typename
@vedantghate92
@vedantghate92 3 жыл бұрын
Bro when we write a function void setData( T x) { kg=x; } what we did?? please explain
@thecountrox
@thecountrox Жыл бұрын
T here is our datatype placeholder since we are passing it as int , T becomes int here so it will be read like : void setData(int x) the next line we are setting kg value to x
@Gandhiboy
@Gandhiboy 4 жыл бұрын
Thank you so much ❤️
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
You’re welcome 😊Please do share the videos and our channel with your friends if you want to genuinely support me & our channel!✌😇
@v.rprasad5377
@v.rprasad5377 4 жыл бұрын
5:16 Why is it not obj1.setData(5) ?
@dhruvkhara
@dhruvkhara 4 жыл бұрын
pele class pass karna padta hai method ke liye badme data type isliye maybe . . . . . . . . ps: new to c++ i am not sure
@v.rprasad5377
@v.rprasad5377 4 жыл бұрын
@@dhruvkhara thank you for the reply bhai. But during function call we mention the data type. I was wondering why not during the method call of a class.
@dhruvkhara
@dhruvkhara 4 жыл бұрын
@@v.rprasad5377 maybe because we declared it before, like normally one we declare int i , j=0 we don't need to declare data type for i or j again
@v.rprasad5377
@v.rprasad5377 4 жыл бұрын
@@dhruvkhara yes but they were generic data types. Anyway leave it
@bhanugoyal5525
@bhanugoyal5525 3 жыл бұрын
because we have to initialze the object first. Then after doing this object call any method from the class.
@azdinator
@azdinator 2 жыл бұрын
Thank you bro
@sharonjoe7535
@sharonjoe7535 3 жыл бұрын
bro @line 29 you passed 053( for the first compilation) but it showed 43(after the first compilation how?
@emirhan1356
@emirhan1356 4 жыл бұрын
but this just a basic usage. can you show us what should we do when we want to use 2 class and we need to send parameters. what will be the parameters type
@khankaloo3409
@khankaloo3409 3 жыл бұрын
how to use class template using separate files.. i.e .h and srcfile
@saisardesai5548
@saisardesai5548 5 жыл бұрын
2:33 why are the functions private while the data members in public? Why would anyone want to do that?
@helloworldof
@helloworldof 4 жыл бұрын
It’s like that so that only the functions are able to access the data members
@v.rprasad5377
@v.rprasad5377 4 жыл бұрын
Just an example to show stacks with elements of different data types.
@rohitdurbha1881
@rohitdurbha1881 6 жыл бұрын
Stacks are Last In First Out memory not First In Last Out
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Yes even you are right but It's just another way of saying it. 👍 Both mean the same buddy, think over it.
@SAG967
@SAG967 4 жыл бұрын
Hey will you post a C++ program to find area of a square using class template
@sahilprasantachoudhury911
@sahilprasantachoudhury911 5 жыл бұрын
Class templates starts from 1: 30 . Thank me later 🙏
@shivajichalise_
@shivajichalise_ 3 жыл бұрын
do you have a tutorial on CRTP ?
@surajsuryawanshi7835
@surajsuryawanshi7835 4 жыл бұрын
Cool bro
@PiyushKumar-ix9jp
@PiyushKumar-ix9jp 3 жыл бұрын
bro can u plz make a video on this template class using file system like i want txt file storing the values
@arshmaanali714
@arshmaanali714 3 жыл бұрын
what is the difference between stack memory allocation and dynamic memory allocation and which more convenient
@ExcellenzaGamer
@ExcellenzaGamer 2 жыл бұрын
stack memory allocation is basically when the compiler allocates specific memory before running the program or while during compiling you can say, and dynamic memory allocation is allocation of memory during running of program, or you can call it as runtime allocation of memory. and when it comes to convenience, it depends on two factors, first is the programmer and the second one is requirement, if the programmer thinks the problem can be solved without dynamically allocating the memory he can do it, but if the requirement is such that he cannot do it without dynamic memory allocation, then he must solve it accordingly.
@anshumanisharma6751
@anshumanisharma6751 5 жыл бұрын
Great!!!
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Most welcome buddy, please do share the videos with your friends too. Thats the biggest help and support you can provide to our channel 😇
@muralit.p2954
@muralit.p2954 3 жыл бұрын
bro can you do a video for STL also?
@manjeshsingh3002
@manjeshsingh3002 4 жыл бұрын
Can we write "class" at the place of typename??
@zainulkhan8381
@zainulkhan8381 4 жыл бұрын
Yes
@Scottko
@Scottko 4 жыл бұрын
Guy talks so fast I had to slow it down
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Hahah sorry for the high speed. Will keep this in mind in future 😅
@IshuSingh-k7f
@IshuSingh-k7f 5 жыл бұрын
why 053 become 43? before you fixed the typo Thankyou :D
@prachikumari7021
@prachikumari7021 4 жыл бұрын
Because whenever we type any number following 0, it is treated as an octal. So here in this case, the template was analogous to int type or decimal so 53 got converted from its octal to decimal form and so we got 43(5x[8^1]+3*[8^0]).
@pawansahu5265
@pawansahu5265 4 жыл бұрын
Thanks..
@saipavank2660
@saipavank2660 6 жыл бұрын
Good one ....😀
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Thank you so much. Please share the video with your friends and contact as that will be the best help and support for our channel 😇✌
@oshoconner4003
@oshoconner4003 3 жыл бұрын
Sir stl ?
@kurapatiakhilkumar5314
@kurapatiakhilkumar5314 5 жыл бұрын
good bro
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thank you buddy, please do share them with your friends :-)
@aayushadhikari7851
@aayushadhikari7851 3 жыл бұрын
GOD level teaching
@kashishgoel1428
@kashishgoel1428 5 жыл бұрын
Best
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thank you so much my friend 😊 Please do share the video with your friends too 😊✌️
@sumitmhaiskar722
@sumitmhaiskar722 5 жыл бұрын
bro tu samjta mast h but pls thoda slow baat kar ekdum fatse mat nikal jaa aramse baat aramse samjha thoda dimag me baithege phir baaki sab mast hai bhai tera acha kaam karra hai
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Thank you Sumit for this genuine feedback. And yes sometimes I tend to speed up while speaking without knowing. I will make sure to speak slow in future :-)
@akwithyou1066
@akwithyou1066 2 жыл бұрын
tHANKSBRO
@ham__edits8
@ham__edits8 Жыл бұрын
👏
@YashPrajapati-js8zd
@YashPrajapati-js8zd 5 жыл бұрын
Bhai apke pas itna knowledge he to any job karte ho ya nahi}?
@SimpleSnippets
@SimpleSnippets 5 жыл бұрын
Kyuki ye teaching work main muje khushi mil rahi hai dost. Kaam wahi karo jaha aapka dil se mann lag raha hai. 😇✌
@melvininfant9295
@melvininfant9295 6 жыл бұрын
Can u post a video about template overloading
@SimpleSnippets
@SimpleSnippets 6 жыл бұрын
Sure will check up on this 😊
@SunitaRani-ys9oy
@SunitaRani-ys9oy 4 жыл бұрын
Itni speed me kon pdhata h....thoda slow hona chaiye taki kisiko reading ka or sochne ka tym mil ske ...🤨🤨🙄dnt like ur teaching style
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Sorry Anil for the high speed. Main future main try karunga ki speed slow rahe. 🙏
@mahesh-jg3zx
@mahesh-jg3zx 5 жыл бұрын
Super super super
@nashhash4625
@nashhash4625 7 жыл бұрын
These are the best videos.Please keep uploading while(1) { cout
@SimpleSnippets
@SimpleSnippets 7 жыл бұрын
+Nash Hash thank you so much Nash! Such a creative comment and positive response buddy. Keep sharing the videos with your friends and contacts ✌️ Follow me on Facebook and Instagram and you can give suggestions about new video tutorials too 😇
@darshandarshan-ph6uk
@darshandarshan-ph6uk 3 жыл бұрын
please provide twitter hash tag we can promote your worthful channel there publicly
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
#simplesnippets
@vasusharma_
@vasusharma_ 5 жыл бұрын
Sir we want overloading template functions
@ShivanshMishra2409
@ShivanshMishra2409 5 жыл бұрын
Bsdk google karle
@letsdoit7083
@letsdoit7083 Жыл бұрын
you are like just reading the code from some website and typing here, no explanation nothing just straight-on writing the code that too idk weird stuff, sorry but i gotta dislike the video.
@VasaMusic438
@VasaMusic438 4 жыл бұрын
You speak too fast !!!
@kuldipsarvaiya2129
@kuldipsarvaiya2129 2 жыл бұрын
You speak too much speedy
@mrs.patriciathomas-evans9115
@mrs.patriciathomas-evans9115 4 жыл бұрын
sing sing sing sing WTF???
@masumali8356
@masumali8356 Жыл бұрын
you are the best..........masum
@kamyagupta4030
@kamyagupta4030 2 жыл бұрын
thank you so much ❤️
@rohitdurbha1881
@rohitdurbha1881 6 жыл бұрын
Stacks are Last In First Out memory not First In Last Out
@dinesh.p8642
@dinesh.p8642 5 жыл бұрын
both mean same ,,buddy
@RathourShubham
@RathourShubham 5 жыл бұрын
lol...wake up
@_a_r_un_
@_a_r_un_ 2 жыл бұрын
Tnq so much ❤️
Recursive Functions in C++ with Example Program & Explanation
11:15
Simple Snippets
Рет қаралды 129 М.
Function Templates in C++ with Program Example | C++ Programmming
11:49
Simple Snippets
Рет қаралды 103 М.
Virtual Functions & Abstract Classes in C++ | C++ Programming Tutorials
15:12
Exception Handling in C++ Programming
10:12
Simple Snippets
Рет қаралды 225 М.
Arenas, strings and Scuffed Templates in C
12:28
VoxelRifts
Рет қаралды 101 М.
Introduction to the C++ Programming Language
3:59:55
Dave Churchill
Рет қаралды 29 М.
Class Templates | C++ Tutorial
12:48
Portfolio Courses
Рет қаралды 59 М.
C++ Programming All-in-One Tutorial Series (10 HOURS!)
10:28:15
Caleb Curry
Рет қаралды 2,3 МЛН
how Google writes gorgeous C++
7:40
Low Level
Рет қаралды 989 М.
Operator Overloading in C++ Programming | C++ Programming for Beginners
13:32