This is driving me nuts!
I finally got the box to output but now I have the problem that nothing is being showing up. It's like there is something wrong with my function to read from the file. I can't figure it out.
This is my input
3
Jordan Lillie
123 Main Street
Anywhere MI, 9999
This is my code;
#include<iomanip>
#include<iostream>
#include <string>
#include <fstream>
using namespace std;
So, there are a few things wrong. I'm going to do a quick response, because I should be out the door. D=
fstream fin("input.txt"); should be either fstream fin("input.txt", ios::in); or ifstream fin("input.txt");.
In PrintSelection, fin<<choice; should probably be fin>>choice;, but you will have a leftover newline in the file stream that needs taken care of.
void main() should be int main(). Not sure how that compiled for you.
I assumed that all input was coming from the TXT file. You should have output at this point. What you will notice is that your address lines are shifted down a line because your first getline read the extra newline that I mentioned. I don't know of a good fix off the top of my head, maybe someone else can help.
Also, you should use fin.close() when you are finished with the file and should return from main.
Sorry for the rushed response, but I hope it helps.
Hey thanks I have fixed and moved on to a new problem which is LOOPS!
This is where I'm at
This is just the main part I didn't copy over the functions I will assume they are all fine because I have tested them. But the problem comes in when I try and use a loop.
Now I have thought that maybe I should use a do loop while loop and I just got some crazy infinite loop. I would like it to be after the algorithm part. If my functions worked previously as I tested them then am I correct to assume that the loop is my trouble?
Thanks