Please Comment, Subscribe and Click Bell🔔🔔🔔 Icon for More Updates. To learn software course from our experts please register here for online training: goo.gl/HIB0wL
@prasadt7722 жыл бұрын
7:19 minor correction: after if(a>s2.a) we have to display -- cout
@monilsompura4 жыл бұрын
Wah Sir Wah!! Apki jitni tariff kare utni kum hai!!!
@rengokuhasira60694 жыл бұрын
Everyone is copying from the book except this teacher nice explanation
@Prashant_Dhanuk9 ай бұрын
Set your heart ablaze
@FREE_BIRD_03 ай бұрын
super super super, as of now, i was completed 24 classes.
@mahesh-ib5wr2 жыл бұрын
minor correction in big function: it may be like: if(a>s2.a) cout
@jishnujishnu8497 жыл бұрын
Thank you sir Nice class
@sangeetalenka83897 жыл бұрын
I have also the same problem .....plz clarify us about this.....as we always find ur explanation is crystal clear....so plz plz explain more about implicit n explicit....
@bfabartzone29004 жыл бұрын
Sir ur explanation was crystal clear.. easily understood... Waiting for more videos!!
@ritikakashyap40305 жыл бұрын
can we use s2 for calling 'big' function??
@RaiMuhammadArslan7865 жыл бұрын
yes,why not!!!!!!!!
@bestganesh4 жыл бұрын
#include #include using namespace std; class sample { private: int a; public: void geta() { cout a; } void puta() { cout
@SMR83444 жыл бұрын
@@bestganesh bro it give u an error because u have not mentioned any test inside the class test is not declared as an object u have to give objects s1,test.... Then after U can access it test.big(s2);
@prasadt7722 жыл бұрын
You are confused bro. 😅 See below. It also works. #include using namespace std; class sample { int a; public: void geta(){ cout
@sharon51962 жыл бұрын
Tku sir ❤️
@katrinejensrud5374 жыл бұрын
Thank you for the explanation. But one Thing isnt clear. When you get a value of 10 from the user,how do you get the value of 15 if you get and print out only one value which is 10?I mean shouldnt you ask the user twice then or use while loop for example?
@haisamuddin23192 жыл бұрын
First value Is of S1 and second value is of S2 object so they both will get different values.. We are not calling same objects for a..
@prasadt7722 жыл бұрын
#include using namespace std; class sample { int a; public: void geta(){ cout
@nareshgoyal19944 жыл бұрын
Sir if a is private memeber then it can only be accessed by the member function na.. Then how can we give s2.a as an argument in bigdata function as a is private member of object s2.. I think it will give errror . Please clear sir I get confuse in this
@softwarefoodiee4 жыл бұрын
You are right. But big() function is public and it belongs to the same class so you can pass it as a argument.
@dhanushreddy43673 жыл бұрын
@@softwarefoodiee So,what do you mean is if we take a class,and in that class if we have multiple functions, we can access the data from that class. Right??? Reply to my query if possible anyone It could clear my doubt....
@prasadt7722 жыл бұрын
In the function 'void big(sample S2)' : sample is a data type just like any other usual function (only it is of type class) and S2 is an argument variable. e.g void add(int x, int y); This is very similar to void big(sample x); You can use any name of your choice other than S2 (like i used 'x' above) even if there's no S2 (or x) object declared in 'main' method. What ever object you declare in 'main' will simply pass on that value to x of 'big' function.
@sungchulyonseiackr Жыл бұрын
You are absolutely correct. There should be a public member function, say, get_a defined. Then you can call s2.get_a(), instead of s2.a. His code will work if a is declared as a public member. Anyway, his lecture is crystal clear to me except this bug.
@americacaptain71403 жыл бұрын
sir, is the big( ) function a member function or a global function?
@amitarya92373 жыл бұрын
here, big is member function because it is declared inside the class.
@haisamuddin23192 жыл бұрын
It is a member function. If you had declared big() with scope resolution operator outside of the class then we could have said that big() is a global function
@prasadt7722 жыл бұрын
It would still be classified as a member function of that class. Simply because :: scope resolution operator itself dictate the scope of that function to be exclusive to that particular class. In other words, it's just another way to write member function for easy readability and to write complex function statements.
@monilsompura4 жыл бұрын
You should come in our University to teach us.!! GLS University, Ahmedabad, Gujarat
@parentingcompas6 жыл бұрын
Really great
@deepshreebuchade30014 жыл бұрын
this we can acheive using operator overloading also than which is better and what is advantage of operator overloading over functions
@rahulreddyambati9065 Жыл бұрын
too good
@lalatendupati80125 жыл бұрын
"a" is private how are you able to access "a" from "s2" obejct
@ilamalihilustan225 жыл бұрын
Because member functions can access the private members of THEIR class. Thus we can access "a" from s1.get( ) or s2.get( )
@devas29795 жыл бұрын
@Vasu Sharma because s2 is an explicit object so we write like that
@rengokuhasira60694 жыл бұрын
@Vasu Sharma Because we are accessing the member function through s1 for s1 it is implicit but for s2 it is explicit that's why we are passing s2 as an argument and we are using s2.a to access it.
@muhammadanasbaloch5084 жыл бұрын
@Vasu Sharma This is so simple dear, it is to tell compiler that from where you are accessing value. If you will not write like this you will get an error from compiler.
@jeffmaness72426 жыл бұрын
This is one way to do this but if you just want to compare s1, s2 wouldn't it be better to overload the assignment operator in the class definition
@prasadt7722 жыл бұрын
Relax Jeff 😅 it's a video in a series of C++ tutorial videos. In this case, overloading is not yet covered at this point in the playlist.
@samriddhidubey97599 ай бұрын
i tried to write this same code but its giving errors
@prokasghosh36604 жыл бұрын
Why s2 write in under class? S2 is object in main()
@muhammadanasbaloch5084 жыл бұрын
To access the member function of sample class. Because S2 is an instance of class Sample like S1. I hope now it's clear.
@oceanview31656 жыл бұрын
At 2.46 second he wrote something that i can't read. Could anyone pls tell me what he wrote ?
@NehalJOtari6 жыл бұрын
clrscr()->to clear the screen
@dr.anitapradhan54894 жыл бұрын
sir ,how can we compare a single value, we need a and b values but u have enter one a value i think bit confusion here
@rengokuhasira60694 жыл бұрын
He is creating two objects that means 2 different blocks of memory is created.
@sahithikomirishetti33806 жыл бұрын
If there are three objects?
@abufaya41556 жыл бұрын
If there are three objects it will look like s1.big(s2,s3); I guess so, sorry if iam wrong.
@sahithikomirishetti33806 жыл бұрын
abu faya is it right
@abufaya41556 жыл бұрын
Sahithi Komirishetti i think so but im not sure try it out.
@sahithikomirishetti33806 жыл бұрын
K
@muhammadanasbaloch5084 жыл бұрын
Then you have to write simple code as you write to compare 3 numbers in big fun but here you will use obj instead of using variables.