delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
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 |
Message-Id: | <4DD84AC8.5030702@saic.com> |
Date: | Sat, 21 May 2011 19:29:12 -0400 |
From: | "Roger K. Wells" <ROGER DOT K DOT WELLS AT saic DOT com> |
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 AT cygwin DOT com |
Subject: | Re: Executing a basic program |
References: | <31668838 DOT post AT talk DOT nabble DOT com> |
In-Reply-To: | <31668838.post@talk.nabble.com> |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
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. 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 DOT k DOT wells AT saic DOT 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |