I am not sure how to ask this question, but I need help in understanding the usage of :: when grabbing a member variable in a class? Rather than just typing that specific member variable instead? For...


I am not sure how to ask this question, but I need help in understanding the usage of :: when grabbing a member variable in a class? Rather than just typing that specific member variable instead?


For Example:


In Hpp file


#include


using namespace std;


class class_name{


void add_name(name);


string variable_name;


};


In CPP file:


void add_name(string name){


class_name::variable_name = name;


}




Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here