question, can you have more than one getchar in a program? cause everytime i have more than one getchar, with an if/else following, the if's and else's get ignored.
here's teh code:
and here's what i get when i run it (it only works if i chose a file that was on the desktop. i.e. if i chose "y" at the first option)
* Created by Peter Noone on 4/6/06.
* Copyright 2006 __MyCompanyName__. All rights reserved.
printf("where is the file you would like to copy? \nif the file is on the desktop, type \"y\" \nif not, type \"n\" \n");
printf("now type the file name.\n");
printf(" type the full path of the file, start with \"/desktop,\" with a \"/\" \n between each foler. \n");
printf("would you like the copy made to the same location? (y/n)\n");
printf("where would you like this file to be copied to?\n");
printf("type the full path of the destination. \n");
sprintf(cp,"cp ~/%s ~/%s", orig, dest);
new-host-2:/users/peter/desktop/other/programming Peter$ ./copy
where is the file you would like to copy?
if the file is on the desktop, type "y"
if not, type "n"
now type the file name.
would you like the copy made to the same location? (y/n)
cp: /Users/Peter/??.?: Invalid argument