i am writing a C++ program to compute if a number is prime or not. i basically have a for loop set up. it tests all the numbers from 2 to the number specified by the user. it can take a little while but thats ok (i'm not worried about speed) however i can get an overflow error. i type in a large number and it will say its prime but it is not testing the right number becase it is to large to be stored.

i am a computer engineering student, i am in a class that is well kinda slow for me. my professor encouraged me to try some on my own and gave me this idea.

my question is how can i store really big numbers, like about a trillion? or even more?