but if i create it inside the operator+ function, i wont be able to assign the value of object temp to object C in main(). As temp scope will only be operator+ function and as soon as the operator+ function is called off, the address that i am passing to the C will no longer point to the values of temp object.

In my MFC application, i created a class which is derived from CTabView and created few tabs(views) using AddView(). Now i want to change the color of the tab views. May i know how to change the background color of those views?

Because at the end of the first time round the while loop ch will contain the newline character, so every other loop will terminate immediately. You must remember to reset variables after you have finished with them. Please get yourself a good study guide on C and learn the language the proper way.

if p = address of the num[0] then (p+i) is the address of the ith address and it is where i want to store the value, *(p+i) will give the value at that address i.e. de-referencing, below is the code i tried.

You are very close. The problem now is your for loops are exceeding the capacity of num. It has 10 elements and your loops go from 0 to 10 inclusively. That is 11 elements - there is no num[11] item so that is a very bad thing.

I don't like literal values so I made the number a const and adjusted the loops :

[edit]
Looking back this seems to be a continuation of your previous questions, but much the same issue. I would strongly suggest you get hold of a good book on C programming and spend a lot of time studying the principles, and getting familiar with structures, arrays, functions etc.
[/edit]