C++: cin >> *char
问题 So, I'm currently writing a line editor as a learning project on I/O, writing files, and the like. It is written in C++, and I am currently trying to write out to a file of the user's choosing. I have CLI arguments implemented, but I currently have no idea how to implement an in program way of specifying the file to write to. char *filename; if (argc >= 2){ filename = argv[1]; } else{ cout << "file>"; cin >> filename; cin.ignore(); } This works perfectly well when I use command line arguments