From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8143 invoked by alias); 21 May 2011 23:31:07 -0000 Received: (qmail 8123 invoked by uid 22791); 21 May 2011 23:31:06 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,TW_CX,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mclmx.mail.saic.com (HELO mclmx.mail.saic.com) (149.8.64.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 21 May 2011 23:30:53 +0000 Received: from 0015-its-sbg02.saic.com ([149.8.64.21] [149.8.64.21]) by mclmx.mail.saic.com with ESMTP id BT-MMP-648959 for cygwin@cygwin.com; Sat, 21 May 2011 19:30:47 -0400 Received: from 0015-its-exbh03.us.saic.com (mcl-sixl-nat.saic.com [149.8.64.21]) by 0015-its-sbg02.saic.com (Symantec Brightmail Gateway) with SMTP id 98.7B.02376.72B48DD4; Sat, 21 May 2011 19:30:47 -0400 (EDT) Received: from 0015-ITS-EXFE02.us.saic.com ([149.8.64.98]) by 0015-its-exbh03.us.saic.com with Microsoft SMTPSVC(6.0.3790.4675); Sat, 21 May 2011 19:30:47 -0400 Received: from [10.30.1.174] ([149.8.64.21]) by 0015-ITS-EXFE02.us.saic.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sat, 21 May 2011 19:30:46 -0400 Message-Id: <4DD84B0C.90200@saic.com> Date: Sat, 21 May 2011 23:31:00 -0000 From: "Roger K. Wells" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: Executing a basic program References: <31668838.post@talk.nabble.com> In-Reply-To: <31668838.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-05/txt/msg00324.txt.bz2 On 05/20/2011 10:10 PM, Agnelomaria wrote: > Hi, > > 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 > output. > ///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 > > #include > #include > #include > #include > #include > #include > #include > 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)) > text.push_back(line); > } > > int main(int argc, char* argv[]) > { > //Part1.read 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. SAIC 221 Third St Newport, RI 02840 401-847-4210 (voice) 401-849-1585 (fax) roger.k.wells@saic.com -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple