Of course it's possible. box2d isn't magic. It's a set of classes and functions that do some calculations for you. Nothing stopping you writing your own.
Open window on screen.
Observe location of mouse click and hold.
Observe location of mouse button release.
From those observations, you have an initial velocity of the ball.
Let time run forwards in steps. Each step, calculate the new position of the ball, and draw it.
Why don't you get an Java IDE and follow the tutorials. Trying to translate it into C++ isn't that easy. Seems Repeater and tpb are kind of experts with this kind of stuff.
For ordinary mortals the problem is that C++ has no support for mouse or graphics and you will need to learn to use external libraries or frameworks and they all have quite a learning curve.
Learning the necessary Java seems much easier and maybe more enjoyable.
As an aside, for those who want to get into doing things like this on Windows using the Win32 API directly, the first few hours of Casey Muratori's "Handmade Hero" is one of the few cases where watching someone else programme is actually very educational.
Lots of C++ "video tutorials" would actually be far better as just a static webpage containing the code and some notes, but Casey's monologue adds real value.
It is not impossible . There are solutions to it, but I have not been able to find solutions, but I've heard that this can be done.
I recently entered C++ programming, and it's a bit hard for me to do. Is it generally difficult to program it, or will it slow down over time as I learn this program?
I want to create a site for iran travel agency using this language. Can this be done better with C++ programming or with php
If it can't be done with C++ it probably can't be done at all, but it doesn't mean you should use C++.
C++ is a general purpose language and for a website you probably need lots of external libraries.
For the web the most popular choice is PHP. It that was designed for web pages so it's much easier to use.
Rascake that was for @saadattravel who wanted to make a website. In that case you're better off not relying on C++ .-. I mean unless you reaaaally reaaaally want to use C++ itself then good luck.