Hello, I\'m trying to read this file into a variable. Any ideahow? \"input file\
ID: 3618293 • Letter: H
Question
Hello, I'm trying to read this file into a variable. Any ideahow?"input file"
160 Then the Voom...It went VOOM! And, oh boy! What a VOOM! Now,don't ask me what a Voom is. I never will know. But, boy! Let me tell you. It doesclean up SNOW!
The first number indicates the size of the array(160).
Is there a way I can use "getline" to read the file? I want tobe able to print it out so that it looks exactly like the file.minus the "160".
Thanks!
"input file"
160 Then the Voom...It went VOOM! And, oh boy! What a VOOM! Now,don't ask me what a Voom is. I never will know. But, boy! Let me tell you. It doesclean up SNOW!
The first number indicates the size of the array(160).
Is there a way I can use "getline" to read the file? I want tobe able to print it out so that it looks exactly like the file.minus the "160".
Thanks!
160 Then the Voom...It went VOOM! And, oh boy! What a VOOM! Now,don't ask me what a Voom is. I never will know. But, boy! Let me tell you. It doesclean up SNOW!
The first number indicates the size of the array(160).
Is there a way I can use "getline" to read the file? I want tobe able to print it out so that it looks exactly like the file.minus the "160".
Thanks!
Explanation / Answer
please rate - thanks because of the array size I would say use character I/O as opposed to string it could be done with getline, but then there would be no reason touse the 160 #include #include using namespace std; int main() {int i,size; ifstream input; input.open("input.txt"); //open file if(input.fail()) //is it ok? { coutsize; char a[size]; for(i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.