Develop a well-documented C++ program that takes a positive integer limit as input and finds and prints out all prime numbers up to the given limit. The program should implement an efficient algorithm to test whether a number is prime and should handle large input values appropriately. The program should output the prime numbers in ascending order separated by a space, and should include appropriate error handling to handle invalid input values. Additionally, the program should be modular, with clearly defined functions for input handling, prime number generation, and output formatting. Finally, the program should be written in a clear and concise style, with appropriate use of comments and white space.
This prompt doesn't seem malicious.