run-length

I need to write a program that I can input a ASCII file into it to decode it. I have saved the file into the same directory as my program but I don't know how to use it when it comes time to run it. My program is as follows:
int N;
char character;
int line=0;
do
{
cin >> N;
if ( N > 0)
{

cin >> character;
cout << endl;
}
else if (N < 0)
cout << "Wrong number" << endl;

else if (N ==0)
{
cout << endl;
}
for (int i = 1; i <= N; i++)
{
cout << character;
line= line + 1;

}

}
while (N >=0);


return 0;

}
You need to look into i/o. A fantastic book for reference is Absolute C++ by Savitch. It will arm you with all of the tools to accomplish this task.
Topic archived. No new replies allowed.