You have to ask the person to enter the file name, using the printf and scanf statement...and when entering the file name you have to be sure to type "filename.txt" also making sure that the text file is in the correct folder.
You have to ask the person to enter the file name, using the printf and scanf statement...and when entering the file name you have to be sure to type "filename.txt" also making sure that the text file is in the correct folder.
Ah, my mistake. However, your scanf should be
The name of an array is pointing to an address, so you wouldn't need the address of operator (&).Code:scanf("%s", name);
Last edited by xxc0dephr34kxx; 11-26-2011 at 12:13 PM.