Question
These are the only tools were allowed to use, my code use 2 get.() methods to pull the junk 'space' between the important info and
These are the only tools were allowed to use, my code use 2 get.() methods to pull the junk 'space' between the important info and then actually get the necessary information with the second get.() function. I talked with my teacher and this is his recommended way of doing it with the tools hes introduced to us thus far. I would appreciate help with the error codes and any tips on how i should interpret this program and any pitfalls i might be hitting with the way im using any of these tools. Would greatly appreciate any in-depth advice you can give. thanks.
\#include \#include using namespace std; int main() // get filename and check if it exists string compressedfile; cout "Enter file name: "; cin > compressedfile; ifstream file(compressedfile); if (!file.is_open()) cout "Error: Could not open file" endl; return 0; int num; char useless; char useful; int count; //syntax issues? unsure why it doesnt like my get. () while (file) \{ ifstream > num; ifstream get. (useless); // get. (useless) and get. (useful) in seperate lines?repetition ifstream get.(useful); \} for (count =1; num; count++) \{ coutStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started