5 thoughts on “Dig Programming

  1. when using composition between classes, is it necessary to make data members ‘static’ so that other classes could manipulate the data members (let’s say the user inputs values for data members of a class using member function of another class)?

    1. it is not required. Moreover static keyword doesn’t provide other classes to access its private member. Static is used to make shared identity which is shared by all object of same class.

  2. is it possible to copy string(let’s say [string name =”hello”]) to an array of characters (‘hello’ is 5 chars so ” char arr[5] “)?

  3. string cannot be directly copied/assigned to a char array because character array doesn’t maps the string requirement in itself. but the same task can be achieved logically (i.e. by using some string functions and doing logical manipulations)

Leave a reply to Expert_Talk Cancel reply