I have this program compiled on latest macOS to read strings from a file.
commands I use: clang++ -std=c++17 -stdlib=libc++ sc_test.cc
followed by: ./a.out document1_short.txt
#include <iostream>
#include <fstream>
using namespace std;
int testSpellingWrapper(int argument_count, char** argument_list) {
const string document_filename(argument_list[1]);
ifstream indoc;
string sentence;
indoc.open(document_filename);
while(getline(indoc, sentence)){
cout<<sentence<<"111"<<endl;
}
indoc.close();
return 0;
}
int main(int argc, char **argv) {
testSpellingWrapper(argc, argv);
return 0;
}
However, it does not cout properly. The 111
shows up on top of the sentence covering the first two letters. I have to cout
the strings along with something else for a programming assignment.
text from document
This is a comlete transcript of Patel's decision, which was issued orally, in which she explains the basis for granting the injunction. Because it marks one of the first times a judge has issued a deciasion in a case of online music-swapping, Patel's interpretation of the lwa is likely to be widely cited in subsequent cases and will be crucial to the Court of Appeals as it grapples with the case.
output
111is is a comlete transcript of Patel's decision, which was 111sued orally, in which she explains the basis for granting 111e injunction. Because it marks one of the first times a 111dge has issued a deciasion in a case of online 111sic-swapping, Patel's interpretation of the lwa is likely 111 be widely cited in subsequent cases and will be crucial 111 the Court of Appeals as it grapples with the case.