My problem looks like that i have class wich have some array and i need to pass it somwhere alse. How to do it? I've tried passing pointer but then when i modify array i get i also modify one in class cause they're the same one.

So is there easy way to copy array of int to another one not using the loop for
Or how can i get thet array from class in such manner that i can edit it without editing one in array.

example:
Code:
class Example
{
  public:
  Example();//let say it already sets values of array[0]=1 and array[1]=2
  ~Example();

don't know what GetArray();//function passing array
int GetArray[1]();//which returns array[1]


  private:
  int array[2];
}
and now i have some function

Code:
int Whatdifferenc(int number)
{
  class Example exm;
  int array2[2],result;
  //passing array from exm to array2
  array2[1]=number;
  result=exm.GetArray[1]()-array2[1];
  return result;
}
Hmm i hope someone will understand my problem.I've made quite a mass not questin but i don't know how to state it clearly