Ok...here is the problem:
"Write an interactive C++ program to prompt the user for a folder name, echoing the response to the display. Your program must store the folder name in a single variable. Show the results of running your program with the following inputs, as shown below,
[run]
Where is the input data file (example: c:\home\john\ )? c:\home\fred\
The data file is located in the folder: c:\home\fred\
[run]
Where is the input data file (example: c:\home\john\ )? c:\home\tom\
The data file is located in the folder: c:\home\tom\"
I worked on it, and I have a program that prints what he asked....
Code:
#include <iostream>
#include <stdlib.h>
#include <cstring>
using namespace std;
int main(int argc, char *argv[])
{
char f[50]; //this is the variable, which is a "char" type
cout << "Where is the input data file (example: c:\\home\\john\\)? \n";
cin >> f;
cout << "The data file is located in the folder: " << f << "\n";
system("PAUSE");
return 0;
}
Is this right? My only issue is this...it says "Your program must store the folder name in a single variable". Is "char" classified as a variable? If it is, then I'm done. Does he mean that I'm supposed to fit all of that text into an actual variable, as in "int"? My delightfully vague teach..
Thanks