HERE IS WHAT I WANT
# I WANT TO MOVE THE BALL DIAGONALLY AND REFLECT ON TOUCHING THE WALLS OR THE BLOCKS.
# AIM IS TO MAKE THE BALL STRIKE ON A BOX AND COLLECT POINTS.
# THE ABOVE THINGS ARE EASY TO MAKE BUT,
I COULD NOT CREATE A FUNCTION THAT CAN MOVE THE BALL WITH OUT LOSING THE CONTROL FROM USER ,THAT IS USER MUST BE ABLE TO MOVE THE BAR (======) TO THE LEFT AND RIGHT WHENEVER HE WANTS
Also you would need non-blocking input, which standard C++ does not provide. You should search for your OS specific functions or get a library which does it for you.
Do you know which library you are going to use for this yet OP? You could technically do this with the standard library but I really would NOT recommend it. You'll spend twice as long creating and inferior product. I usually suggest SFML to people since that is the one that I am most familiar with. But SDL and Allegro are two more good choices with a decent sized following among our contributing members.