This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Executing a basic program

On 05/20/2011 10:10 PM, Agnelomaria wrote:

I am just learning to program in C++ . I am following  a book called
Exploring C++ . The first task is to execute the code which I will paste
below. I have compiled the code . I tried executing the code using ./a.exe
command but the code does not seem to terminate. I have no idea what the
code means. the book asks the user to try the code so as to get familiarized
with the coding environment. Could someone please help me execute the code.
I am not sure what input I should provide

Code :

///sort the standard input alphabetically
///read teh lines of the text sort themand print theresults tothe standard
///if the command line names a file, read from that file. Otherwise, read
fromt he standard input.
///the entire file is stored int he memory so donot tyr thiswiht input files
that ecxeed the size of the ram


we need some filenames here.
then I'll try to help.
roger wells
void read(std::istream&  in, std::vector&  text)
	std::string line;
	while (std::getline(in, line))

int main(int argc, char* argv[])
	// the entire input into the text.. If the command line names a
file, read that file. Otherwise ,read the standard input
	std::vector text; ///(std::cout, "\n"));


Roger Wells, P.E.
221 Third St
Newport, RI 02840
401-847-4210 (voice)
401-849-1585 (fax)

-- Problem reports: FAQ: Documentation: Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]