...i dont know what the difference between an app and a webserver are.
The important difference between a web server and an "apps" or web pages is that one is a server and the others are clients.
They communicate using TCP/IP. That means that the clients connect to the servers and make requests. There can be many clients connecting to the server at the same time. The server does not initiate connection to the clients.
The practical upshot of this is that if you run your Flask web server on a Pi at home, on your local network, you need some things to make it accessible to apps and web browsers out in the world on the internet:
1) You need a "public" IP address for your home LAN that can be reached from users out in the world. Your Internet Service Provider (ISP) may or may not allocate you a public IP address. If yes, you are good to go. If not you have problems.
2) Once it is possible to access your home LAN from the outside, typically that is your internet router, you need to configure it to forward connections to your Flask web server on the Pi. So called "port forwarding". If your router allows this you are good to go. If not you have problems.
3) With all that in place it's generally better to have a domain name registered that can be used by outsiders to resolve a human memorable name to an IP address. You can get yourself a domain name very cheaply from people like godaddy.com. Having a domain name also helps when your public IP address changes, you just point the Domain Name System (DNS) at your new IP address. If you can do all that you are good to go. If not you have problems.
4) You will of course want your system to be secure when opened to the public internet. To that end you will need to tweak your Flask web server to use HTTPS. In order to use HTTPS you will need security certificates related to the domain name you have registered above. You can get those for free from letsencrypt.org. If you can do that you are good to go. If not you have problems.
5) Of course even with HTTPS your Flask web server is in no way secure unless you implement some kind of user login system with user names, passwords etc. If you can do that you are good to go. If not you have problems.
Are you sure you want to do all this?
Or take a short cut. Sign up for dataplicity.com. With their free service you can connect to your Pi from anywhere in the world with a web browser and get a command line shell access to it. Not only that, dataplicity can create a tunnel to allow access to your web server.
Memory in C++ is a leaky abstraction .