Help with drawing

#include <iostream>
#include <fstream>
#include <string>

using namespace std;

void printSpace(ifstream& , ofstream&);
void printP(ifstream& , ofstream&);
void printNewLine(ifstream& , ofstream&);

int main(){
const int MAX_FOR = 3;
ifstream inFile;
ofstream outFile;
inFile.open("InputDrawing.txt");
outFile.open("Drawing.txt");
string str;
for (int i = 0; i < MAX_FOR; i++){
getline(inFile, str);
}

char firstChar;
int num;

inFile.get(firstChar);
while (inFile){
cout << "firstChar = " << firstChar << endl;
switch (firstChar){
case 's' : printSpace(inFile, outFile); break;
case 'p' : printP(inFile, outFile); break;
case 'n' : printNewLine(inFile, outFile); break;
default:break;
inFile.get(firstChar);
}
}
inFile.close();
outFile.close();

return 0;
}

//Prints "num" number of spaces into the outfile
void printSpace(ifstream& inFile, ofstream& outFile) {
int num;
string test;
inFile >> test >> num;
for (int i = 0; i < num; i++){
outFile << " ";
}
}
// prints "num" number of A's into the outfile
void printP(ifstream& inFile, ofstream& outFile) {
int num;
string test;
char character;
inFile >> test >> num >> character;
for (int i =0; i < num; i++){
outFile << character;
}
}
// prints "num" spaces of newline
void printNewLine(ifstream& inFile, ofstream& outFile) {
string blankline(65,' ');
outFile << blankline;

}





My code builds, however the output file is blank

Any help would be greatly appreciated
Topic archived. No new replies allowed.