Newbie C++ programer with an question. I have a dice roller program that I want to use in different program and I know there is a better way to add than copy and paste all of the code, but dont know how. Can I attached it as a file and call the file in my main program?
You have inadvertently discovered why libraries are useful. You can compile your dice roller as a library file and then link to it in each of your other programs. You may need to adjust the design of your code so that it is not specific to any particular program.