delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=0.1 required=5.0 tests=AWL,BAYES_50,RCVD_IN_RP_RNBL,T_RP_MATCHES_RCVD |
X-Spam-Check-By: | sourceware.org |
Message-ID: | <4C87CA1A.9070301@sh.cvut.cz> |
Date: | Wed, 08 Sep 2010 19:38:34 +0200 |
From: | =?UTF-8?B?VsOhY2xhdiBIYWlzbWFu?= <v DOT haisman AT sh DOT cvut DOT cz> |
User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 |
MIME-Version: | 1.0 |
To: | cygwin AT cygwin DOT com |
Subject: | Re: rand() was not declared in this scope, please help‏ |
References: | <CD7CFA1134410784EA0A1AA09A4D2A5B AT ericlin DOT fsshl DOT zzn DOT com> |
In-Reply-To: | <CD7CFA1134410784EA0A1AA09A4D2A5B@ericlin.fsshl.zzn.com> |
X-IsSubscribed: | yes |
Reply-To: | cygwin AT cygwin DOT com |
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 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 eric lin wrote, On 8.9.2010 19:35: > dear cygwin/gcc users: > > I compile a simple code which i copied from a book, "The Complete Reference of C++" Fourth Edition by Herbert Schildt in page 575, rand() > which is clearly not be included in > #include <iostream> > > I tried > #inlcude <cmath> > > it still not compile, i.e. same compile error > > please help(see which lib I should include) > /* I tried in ubuntu linux on my laptop, it also not compile by same reason */ You need to #include <cstdlib> and use std::rand(). - -- VH -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREIAAYFAkyHyhoACgkQeqrf2dJjGj4mMwD+L7zWAHf7L34vlph03R5TY4Rw pizg2rsAWzelNkZHYGoBAMMSTJU7BF65E84+U5SAn2avkW/ZNGnGsj/aHeRnZHex =4x2u -----END PGP SIGNATURE----- -- 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 |