Static Member Functions | C++ Tutorial | Mr. Kishore
Vložit
- čas přidán 17. 04. 2017
- C ++ Tutorial Videos | Mr. Kishore
** For Online Training Registration: goo.gl/r6kJbB ► Call: +91-8179191999
💡 Also Watch
C Language Tutorials: goo.gl/qDhJ2r
Core Java FAQ's: goo.gl/qGh5mA
Core Java Tutorials: goo.gl/NbaEge
Java Programming Tutorials by Mr.Hari krishna:
goo.gl/HThq6H
Advanced Java Programming Tutorials by Mr.Nataraj:
goo.gl/1U2Qgy
Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.
💡 Visit Our Websites
For Classroom Training: nareshit.in/cpp-training/
For Online Training: nareshit.com/c-online-training/
#JavaCollectionsFramework #Tutorials #Videos #corejava #Quiz #Clanguage
--------------------------
💡 About NareshIT:
"Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations
--------------------------
💡 Our Online Training Features:
🎈 Training with Real-Time Experts
🎈 Industry Specific Scenario’s
🎈 Flexible Timings
🎈 Soft Copy of Material
🎈 Share Videos of each and every session.
--------------------------
💡 Please write back to us at
📧 us.training@nareshit.com/ 📧 online@nareshit.com or Call us at the USA: ☎+1404-232-9879 or India: ☎ +918179191999
--------------------------
💡 Check The Below Links
► For Course Reg: goo.gl/r6kJbB
► Subscribe to Our Channel: goo.gl/q9ozyG
► Circle us on G+: plus.google.com/+NareshIT
► Like us on Facebook: / nareshit
► Follow us on Twitter: / nareshitek
► Follow us on Linkedin: goo.gl/CRBZ5F
► Follow us on Instagram: goo.gl/3UXYK3
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
What can I say? I wish I had known you in 2017! No one has explained C++ in such details as you did. Wish you a world for the job you do..
I rarely comment for CZcamsrs but sir you are outstanding amazing fabulous you deserve the respect ,from us
may I know whether are you in college or school??
@@molyoxide8358 hrrr jagah Panchayati krni hai Londo ko....
Super sir... tomorrow need to take lesson of static.. valuable and timely help
These faculties are so down to earth. Look how humbly they speak.
best c++ teacher I have seen on youtube
Well explained..😇Thankyou sir♥️
you teach like a pro teacher...
Thank you for clearing doubt sir.
Outstanding explanation sir
terimakasih pakde Kishore 🙏🏻
Thanks a lot ...........
Thank ou sir
Whether we need to define static member functions outside the class , in the same way that we define static data members
Thank you sir🙏
in first example..x and y are not defined ...they are directly passed as parrameter
Thank u sir
Sir tq meru chepthunadhi maku bhaga ardham indhi but konchem program tho explain chesthy bhaguntundhi sir
class ajay
{
private:
int a,b;
public:
int c,d;
static int e;
};
int ajay::e;
int main()
{
ajay a1;
//ajay::c; //ERROR-->invalid use of non-static data member 'ajay::c'
ajay::e; //Valid
}
as c is not a static member so it gives error
so to access c varible .so a1.c should be used
i think so
sir in the main part we have to write the data type na sir first and after that we can write class name but you wrote cls name first why sir
if we havent declared x and y as static how do function know they are static?
Here x and y are not data members.They are actually local variable.
SO they can't be static or non-static:D
@@osamaa1891 static member functions only work with static data members
Can static data member work in private section also
@@osamaa1891 in firstv example they are bot declared
@@sharath5796 i also confused at this point
Thanks a lot sir ji
In the first program u have static mem function but did not have static data members, so then how it is working???
they were local variable for the static function. so there's no need to declare it as a static or non-static.
Sir in previous lecture you says static data member are declare inside public section
same doubt sir
#include
using namespace std;
class sample {
public:
static void input (int x, int y) { // now even tho maine static data members pehle declare nahi kiye hai this will still work.
cout
I think after making data members static also give error bcoz they are declared under private section
And they are acessed by the member function of that class so i think there is no error
@@amandeepbhullar1860 if you want to access them through class name in main fun then they must be in public section
Karan Negi No member functions and data members which is declared in same class and if Data members are declared as private then still Member functions can acess that private variable because they are declared inside the same class. Another way to acess a private data member is using friend functions.
#include
#include
#include
using namespace std;
class ajay
{
private:
int a,b;
public:
static void getdata() //Only static data member is allowed in static member function
{
a=10; //ERROR-->invalid use of member 'ajay::a' in static member function
b=20; / /ERROR-->invalid use of member 'ajay::b' in static member function
cout
Super
U r saying that Static data members can be accessed with class but for class memory will not be created bcoz it is logically exists but not physically until n unless object created for that class memory won't be created
All static members are created during program start and will remain till program end. So these static members are not part of class memory
Do you want answer for this question??
#include
#include
#include
using namespace std;
class ajay
{
private:
int a,b;
public:
void getdata()
{
a=10;
b=20;
cout
#include
#include
#include
using namespace std;
class ajay
{
private:
static int a,b;
public:
static void getdata()
{
this->a=10; //ERROR-->'this' is unavailable for static member functions
this->b=20; ////ERROR-->'this' is unavailable for static member functions
cout
Try to improve the teaching language in tamil