Hey,
I am a beginner user of c++.
and I have a question concerning pointers.
Is there any deference for using regular variables, while programming, or pointers to avoid messing up with the variables?
Could you give a snippet of code? I am not sure that I can understand what you are asking without seeing a code example. Deference is not the same as dereference, so I am confused by your question.
Between those two examples you just posted, ex1 is much better. I actually prefer variables instead of pointers in almost every situation. Variable references are always guaranteed to be allocated, whereas pointer references lack that guarantee.