I wrote a simple game in netbeans that I want to add to my website .
the game accepts user input and saves/deletes/updates user data on a file.
how would I go about doing this ?
For as far as I know you can't host a C++ application as part of your website and have visitors run the application through their browser.
What you could do is compress your application in a zip file and allow visitors to download that zip-file and run the program on their own computer (if they think that is a safe thing to do), but that is probably not what you are looking for.
If you want to write a program in C++ that users can interact with online through their browser, than your program should contain/be a server. If that is what you want, you probably want to have a look at https://en.wikipedia.org/wiki/Mongoose_(web_server) as that would be a fairly simple way to get started.