tags:

views:

114

answers:

2

I want the user to be able to type some text and then the computer creates a file called what ever the text was. In C++.

+1  A: 

Because this looks like homework, I'm not giving a complete example.

Look in:

  • #include <iostream> (Preferred) or
  • #include <cstdio> (Legacy)
Billy ONeal
+3  A: 
#include <cstdlib>

int main() {
    return system("read FILE && touch \"$FILE\"");
}

Note: Requires POSIX. Should be OK, practically all modern OSes are POSIX-compatible.

John Kugelman
+1, does satisfy user requirements
aaa
haha, clever :-)
nebukadnezzar