dev-cpp-users Mailing List for Dev-C++ (Page 417)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Ricardo R. <ri...@po...> - 2003-03-21 10:03:42
|
Essentially you want to allocate memory for a char matrix in a dynamical
way.
(1) First you must allocate memory for the rows.
Imagine you need to store 50 strings, then p should point
to a pointer array able to allocate the 50 memory positions
of your 50 strings:
p = (char **) malloc(50*sizeof(char*));
(2) Second you want allocate in each row a string with a maximum
of 80 characters, then you should reserve this memory:
for(i=0 ; i<50 ; i++)
p[i] = (char *) malloc(80*sizeof(char));
(3) Now tou can store your strings:
for(i=0 ; i<50 ; i++)
{
printf("\n Give me a char string: ");
gets(p[i]);
}
(4) Finally you free the allocated memory in this way:
for(i=0 ; i<50 ; i++) free(p[i]);
free (p);
Hope this can help you.
Ricardo.
|
|
From: Ian H. <Ia...@ma...> - 2003-03-21 09:35:31
|
The following is a bit of C code that uses the current time as a seed.
It's an example I have so it may have bits you will need to modify
(Namespaces and .h files etc.)
But it does work.=20
/*
** Program to demonstrate the use of the rand function
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char *argv[])
{
int nCount;
int nRandom;
/* Seed random number generator with current time */
srand((unsigned)time(NULL));
/* Display 20 random positive integers */
for(nCount=3D0; nCount<20; nCount++)
{
nRandom=3Drand();
printf("%d ", nRandom);
}
=20
system("PAUSE");
return 0;
}
|
|
From: Richard C. <tel...@ya...> - 2003-03-21 08:51:22
|
thing with random numbers is, the same input put into the same processes will only every generate the same "random" numbers, hence the term pseudo- random. it was always my understanding that srand() had to be called before rand() but apparently that's not the case... *shrug* but from ioannis it seems rand() must have a default seed it runs off. but most random number classes require a seed, just as a starting point. if this seed is the same, then the random numbers will be the same. but using the system time is a pretty good way to mix up your numbers a bit. |
|
From: Daniel G. <sp...@ho...> - 2003-03-21 08:19:55
|
Hi all, I hope you can help.
I've inherited some code, and have a small prob. I have a base class, CBase,
and a derived class, CDerived. What I've then done is to create a third
class, CNew, and there is only one instance of this class (so the members
are all static const, and the object is derived in the header file as static
CNew NewObj. I've put
CNew& NewObj;
as a member in CBase.
Ok? Good now here is the hard bit. I currently access the members of CBase
without the scope reolution operator or by dereferencing, that is I can
write
int Var = MemberOfBase;
in the member function bodies of CDerived. I think this is because of the
constructor: it looks like
CDerived(int x, int y)
: CBase(int x, int y)
{
//...
}
My question is: How do I get the same effect using CNew? How can I do
int Var = MemberOfNew;
? I'm told that it can be achieved as the object of CNew is a reference, but
I'm puzzled as how I dereference a reference so I can write the above
instead of
int Var = NewObj.MemberOfCNew
Is that clear?
Daniel
_________________________________________________________________
Surf together with new Shared Browsing
http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID=74&DI=1059
|
|
From: Luigi S. <gi...@li...> - 2003-03-21 06:41:49
|
On Thu, Mar 20, 2003 at 12:03:33PM -0000, Kieran Walshe wrote: > Hi, > > Are there any tools/utilities/packages that will convert a Makefile (using gcc) into a Dev-C++ project? > > Or does anyone know of some good documentation that would guide you through it. > > Thanks > > Kieran > Hello, Kieran there seems to be no such tool (yet), but why do you need one? IMHO, the idea behind 'projects' is to have user not deal with makefile directly, instead Dev-C++ will use information written in the project to write the makefile for you. So if you already have the makefile, just use Make to compile your program and forget about the project :-) However, if you wish to manually "convert" the makefile, you could: - open Dev-C++ and create an empty project - open the makefile in the editor - add to the empty project, any source file whose name is found in the makefile > > > The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed and may also be privileged. > If you are not the addressee of this e-mail you may not copy, forward, disclose or otherwise use it or any part of it in any form whatsoever. > If you have received this e-mail in error please report it to the postmaster at <mailto:in...@ce...> > Any views held by employees in this message do not necessarily represent the views and opinions of CENDRIS Limited. > Please try to avoid using mail servers which add messages like the above to your mails, they sound harassing to me :-) ... I'm not the addressee but am using part of it, I hope, to help you, should I report it to the postmaster? ;-) -- >> gisan >> |
|
From: <and...@su...> - 2003-03-21 03:05:08
|
1-#include <stdlib.h>
2-#include <stdio.h>
3-int main()
4-{
5-
6- char **p, name[80];
7-
8- ... commands ...
9-
10- return(0)
11-}
Suppose p will store a set of names (strings), that is, on position *p will
be the variable sized "text1", position *(p+1) will be "text2" and so on.
Variable sizes are up to 80. I will do:
1-some gets(name) commands to store the several "texts" at each
iteraction;
2-execute a malloc command;
3-store name contents inside each position of p, one per address; and
4-free the pointer at the end of the program.
Question(s):
A) Is that clear my statement for you? If its,
B) How can I use the malloc command for this case? At each
iteraction/storage? One malloc for
each *p and other for the **p one?
Thanks
Andre
|
|
From: ML <mik...@op...> - 2003-03-20 22:29:26
|
Hi, I can import a dsp file with file-->import, how do I handle dsw files. is there a msdev clone? thanks, mike |
|
From: Daniel K. O. <dan...@ya...> - 2003-03-20 20:13:56
|
GLib has a threads library: "Threads thread abstraction; including threads, different mutexes, conditions and thread private data." Download it from www.gtk.org, or the pre-compiled at www.gimp.org/win32 The API is also available at http://developer.gnome.org/doc/API/2.0/glib/glib-Threads.html (just in case you want to check out before downloading it) Daniel K. O. It's OK to be ignorant; it's not OK to play stupid. http://www.catb.org/~esr/faqs/smart-questions.html > -----Mensagem original----- > De: dev...@li... > [mailto:dev...@li...]Em nome de David McKen > Enviada em: quinta-feira, 20 de março de 2003 10:03 > Para: Dev-C Mailing List > Assunto: [Dev-C++] Portble Threads (is there really such a thing?) > > > I am assisting with a project that I believe will benifit > from the use of threads. However the group that I am > working with does not want tolose portability just to get > threads. What portable thread packages are avalible and are > there any success stories that anyone on the list has had > with these various packages. > > Thanks in advance > David McKen |
|
From: Francisco V. <fco...@pr...> - 2003-03-20 18:00:23
|
=09=09How can I write a library with Dev-C++. I=B4m not talking about= class library, just I want to add a function to libraty file. |
|
From: Ioannis V. <iv...@em...> - 2003-03-20 17:26:09
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Daniel Glenfield > Sent: Thursday, March 20, 2003 6:59 PM > To: pw...@ia... > Cc: dev...@li... > Subject: Re: [Dev-C++] C99 >=20 >=20 > Well coding standards, you know guidelines on variable names,=20 > how you should=20 > write code (to be portable etc.) nothing like creating a=20 > standard that other=20 > companies follow or anything (though one was rumoured to have=20 > copied ours a=20 > bit). It's not a big thing really lol. When we are talking about language standards we are refering to international standards. :)=20 It's in my future plans to post a free "upgrade quick guide from C90 to = C99" online sometime in the future. However keep in mind that Dev-C++ already supports C99 (with the -std=3Dc99 compiler switch). Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys |
|
From: Ioannis V. <iv...@em...> - 2003-03-20 17:15:42
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of francesca=20
> Sent: Thursday, March 20, 2003 5:28 PM
> To: dev...@li...
> Subject: [Dev-C++] help float
>=20
>=20
> Hi,
> I use Dev-C++ 9.7.0 OS Win 2000.
> When I write simply:
>=20
> #include <iostream>=20
// stdio.h is not needed
> #include <stdio.h>=20
> #include <stdlib.h>=20
Better: #include <cstdlib>
Better not using-statement here.
> using namespace std;
>=20
>
> main()
Int main()
> {
using namespace std;
> float a;
> a=3D16/3;
> cout<<a<<endl;
> system("PAUSE");
> return 0;
> }
>=20
> the compilation finishes correctly, but the program=20
> visualizes only 5 without decimates them!=20
> why?
16/3 is an int expression. The result is then converted and assigned to =
your
float. 16.0/3 (which is double), or 16.0f/3 would do the job you want.
Ioannis Vranos
=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL: http://run.to/noicys
|
|
From: Reid T. <Rei...@at...> - 2003-03-20 17:14:14
|
or perhaps a=3D16.0/3.0
--
thanks,
reid
-----Original Message-----
From: Per Westermark [mailto:pw...@ia...]=20
Sent: Thursday, March 20, 2003 12:30 PM
To: Adam Malinowski
Cc: francesca; dev...@li...
Subject: Re: [Dev-C++] help float
Or just a =3D 16./3.;
/Per W
On Thu, 20 Mar 2003, Adam Malinowski wrote:
> Hi.
> It' simple.
> > a=3D16/3;
> 16 an 3 are integer values so reult is also integer value.
> If you do somthing like that:
>
> float b=3D16, c=3D3;
> a =3D b/c;
>
> it will work fine.
> Or you can try:
>
> a =3D (float)16/(float);
>
> Regards.
> Adam
>
> ----- Original Message -----
> From: "francesca " <pin...@li...>
> To: <dev...@li...>
> Sent: Thursday, March 20, 2003 4:28 PM
> Subject: [Dev-C++] help float
>
>
> > Hi,
> > I use Dev-C++ 9.7.0 OS Win 2000.
> > When I write simply:
> >
> > #include <iostream>
> > #include <stdio.h>
> > #include <stdlib.h>
> > using namespace std;
> >
> > main()
> > {
> > float a;
> > a=3D16/3;
> > cout<<a<<endl;
> > system("PAUSE");
> > return 0;
> > }
> >
> > the compilation finishes correctly, but the program visualizes only=20
> > 5
> without decimates them!
> > why?
> >
> > Any help is appreciated
> >
> > francesca
> > --
>
>
>
> ----------------------------------------------------------------------
> WOJNA stala sie faktem! RELACJE jedynych polskich dziennikarzy w=20
> Iraku.
> >>> http://link.interia.pl/f16f7
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Tablet PC.
> Does your code think in ink? You could win a Tablet PC.
> Get a free Tablet PC hat just for playing. What are you waiting for?=20
> http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
> _______________________________________________
> Dev-cpp-users mailing list Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
-------------------------------------------------------
This SF.net email is sponsored by: Tablet PC. =20
Does your code think in ink? You could win a Tablet PC.=20
Get a free Tablet PC hat just for playing. What are you waiting for?=20
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Per W. <pw...@ia...> - 2003-03-20 17:08:27
|
Your company have their own C++ standard??? /Per W On Thu, 20 Mar 2003, Daniel Glenfield wrote: > I'm not educated in these standards really. With regards to C++ our company > have our own. > > > > > > > >From: David McKen <ci...@ya...> > >Reply-To: ci...@ya... > >To: Dev-C Mailing List <dev...@li...> > >Subject: Re: [Dev-C++] C99 > >Date: Thu, 20 Mar 2003 05:07:14 -0800 (PST) > > > >How would I check? > > > >(The standard you mean? Not exactly sure. How different is > >it from standard C?) > > > > > >--- Ioannis Vranos <iv...@em...> wrote: > > > Has anyone learned C99? I want just to check C99 > > > penetration on the public > > > (I suspect its towards 0). > > > > > > > > > > > > > > > Regards, > > > > > > Ioannis Vranos > > > > > > * Programming pages: http://www.noicys.freeurl.com > > > * Alternative URL: http://run.to/noicys > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: Does your code think > > > in ink? > > > You could win a Tablet PC. Get a free Tablet PC hat just > > > for playing. > > > What are you waiting for? > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > > > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > >===== > >Signed > >David Mcken > > > >Life Sucks > >Live with it > > > >__________________________________________________ > >Do you Yahoo!? > >Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! > >http://platinum.yahoo.com > > > > > >------------------------------------------------------- > >This SF.net email is sponsored by: Tablet PC. > >Does your code think in ink? You could win a Tablet PC. > >Get a free Tablet PC hat just for playing. What are you waiting for? > >http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en > >_______________________________________________ > >Dev-cpp-users mailing list > >Dev...@li... > >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > _________________________________________________________________ > Use MSN Messenger to send music and pics to your friends > http://messenger.msn.co.uk > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Tablet PC. > Does your code think in ink? You could win a Tablet PC. > Get a free Tablet PC hat just for playing. What are you waiting for? > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Daniel G. <sp...@ho...> - 2003-03-20 16:59:13
|
Well coding standards, you know guidelines on variable names, how you should write code (to be portable etc.) nothing like creating a standard that other companies follow or anything (though one was rumoured to have copied ours a bit). It's not a big thing really lol. >From: Per Westermark <pw...@ia...> >To: Daniel Glenfield <sp...@ho...> >CC: dev...@li... >Subject: Re: [Dev-C++] C99 >Date: Thu, 20 Mar 2003 18:27:58 +0100 (CET) > >Your company have their own C++ standard??? > >/Per W > >On Thu, 20 Mar 2003, Daniel Glenfield wrote: > > > I'm not educated in these standards really. With regards to C++ our >company > > have our own. > > > > > > > > > > > > > > >From: David McKen <ci...@ya...> > > >Reply-To: ci...@ya... > > >To: Dev-C Mailing List <dev...@li...> > > >Subject: Re: [Dev-C++] C99 > > >Date: Thu, 20 Mar 2003 05:07:14 -0800 (PST) > > > > > >How would I check? > > > > > >(The standard you mean? Not exactly sure. How different is > > >it from standard C?) > > > > > > > > >--- Ioannis Vranos <iv...@em...> wrote: > > > > Has anyone learned C99? I want just to check C99 > > > > penetration on the public > > > > (I suspect its towards 0). > > > > > > > > > > > > > > > > > > > > Regards, > > > > > > > > Ioannis Vranos > > > > > > > > * Programming pages: http://www.noicys.freeurl.com > > > > * Alternative URL: http://run.to/noicys > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.net email is sponsored by: Does your code think > > > > in ink? > > > > You could win a Tablet PC. Get a free Tablet PC hat just > > > > for playing. > > > > What are you waiting for? > > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en > > > > _______________________________________________ > > > > Dev-cpp-users mailing list > > > > Dev...@li... > > > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > > > > > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > >===== > > >Signed > > >David Mcken > > > > > >Life Sucks > > >Live with it > > > > > >__________________________________________________ > > >Do you Yahoo!? > > >Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! > > >http://platinum.yahoo.com > > > > > > > > >------------------------------------------------------- > > >This SF.net email is sponsored by: Tablet PC. > > >Does your code think in ink? You could win a Tablet PC. > > >Get a free Tablet PC hat just for playing. What are you waiting for? > > >http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en > > >_______________________________________________ > > >Dev-cpp-users mailing list > > >Dev...@li... > > >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > _________________________________________________________________ > > Use MSN Messenger to send music and pics to your friends > > http://messenger.msn.co.uk > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Tablet PC. > > Does your code think in ink? You could win a Tablet PC. > > Get a free Tablet PC hat just for playing. What are you waiting for? > > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > _________________________________________________________________ Overloaded with spam? With MSN 8, you can filter it out http://join.msn.com/?page=features/junkmail&pgmarket=en-gb&XAPID=32&DI=1059 |
|
From: Per W. <pw...@ia...> - 2003-03-20 16:41:08
|
Or just a = 16./3.;
/Per W
On Thu, 20 Mar 2003, Adam Malinowski wrote:
> Hi.
> It' simple.
> > a=16/3;
> 16 an 3 are integer values so reult is also integer value.
> If you do somthing like that:
>
> float b=16, c=3;
> a = b/c;
>
> it will work fine.
> Or you can try:
>
> a = (float)16/(float);
>
> Regards.
> Adam
>
> ----- Original Message -----
> From: "francesca " <pin...@li...>
> To: <dev...@li...>
> Sent: Thursday, March 20, 2003 4:28 PM
> Subject: [Dev-C++] help float
>
>
> > Hi,
> > I use Dev-C++ 9.7.0 OS Win 2000.
> > When I write simply:
> >
> > #include <iostream>
> > #include <stdio.h>
> > #include <stdlib.h>
> > using namespace std;
> >
> > main()
> > {
> > float a;
> > a=16/3;
> > cout<<a<<endl;
> > system("PAUSE");
> > return 0;
> > }
> >
> > the compilation finishes correctly, but the program visualizes only 5
> without decimates them!
> > why?
> >
> > Any help is appreciated
> >
> > francesca
> > --
>
>
>
> ----------------------------------------------------------------------
> WOJNA stala sie faktem! RELACJE jedynych polskich dziennikarzy w Iraku.
> >>> http://link.interia.pl/f16f7
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Tablet PC.
> Does your code think in ink? You could win a Tablet PC.
> Get a free Tablet PC hat just for playing. What are you waiting for?
> http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Adam M. <up...@in...> - 2003-03-20 16:09:44
|
Hi.
It' simple.
> a=16/3;
16 an 3 are integer values so reult is also integer value.
If you do somthing like that:
float b=16, c=3;
a = b/c;
it will work fine.
Or you can try:
a = (float)16/(float);
Regards.
Adam
----- Original Message -----
From: "francesca " <pin...@li...>
To: <dev...@li...>
Sent: Thursday, March 20, 2003 4:28 PM
Subject: [Dev-C++] help float
> Hi,
> I use Dev-C++ 9.7.0 OS Win 2000.
> When I write simply:
>
> #include <iostream>
> #include <stdio.h>
> #include <stdlib.h>
> using namespace std;
>
> main()
> {
> float a;
> a=16/3;
> cout<<a<<endl;
> system("PAUSE");
> return 0;
> }
>
> the compilation finishes correctly, but the program visualizes only 5
without decimates them!
> why?
>
> Any help is appreciated
>
> francesca
> --
----------------------------------------------------------------------
WOJNA stala sie faktem! RELACJE jedynych polskich dziennikarzy w Iraku.
>>> http://link.interia.pl/f16f7
|
|
From: Per W. <pw...@ia...> - 2003-03-20 15:49:40
|
Yes, modulo with a prime number is better than modula 2^x, but care is still needed. /Per W On Thu, 20 Mar 2003, Dave McMinn wrote: > > > The problem with the normal rand() is that the low bits of it > > are not very > > rando, so rand()%11 have a tendancy to generate a very ugly pattern. > > Isn't that going to be less of a problem when using 11 (or some other non power of 2) with the modulus operator? In those cases, high bits will still have an > effect on the resulting number. > > ------------------------------------------------------- This SF.net email is sponsored by: Tablet PC. Does your code think in ink? You could win a Tablet PC. Get a > free Tablet PC hat just for playing. What are you waiting for? http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en > _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: > http://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Nicolas G. <nic...@in...> - 2003-03-20 15:45:20
|
Peurhaps you can try:
a=16/3.0;
because I think but i'm not sure that the fact to do 16/3 returns an
(int) because of 3
On Thu, 20 Mar 2003, francesca wrote:
> Hi,
> I use Dev-C++ 9.7.0 OS Win 2000.
> When I write simply:
>
> #include <iostream>
> #include <stdio.h>
> #include <stdlib.h>
> using namespace std;
>
> main()
> {
> float a;
> a=16/3;
> cout<<a<<endl;
> system("PAUSE");
> return 0;
> }
>
> the compilation finishes correctly, but the program visualizes only 5 without decimates them!
> why?
>
> Any help is appreciated
>
> francesca
>
|
|
From: francesca <pin...@li...> - 2003-03-20 15:29:20
|
Hi,
I use Dev-C++ 9.7.0 OS Win 2000.
When I write simply:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
main()
{
float a;
a=16/3;
cout<<a<<endl;
system("PAUSE");
return 0;
}
the compilation finishes correctly, but the program visualizes only 5 without decimates them!
why?
Any help is appreciated
francesca
--
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr
Powered by Outblaze
|
|
From: Daniel G. <sp...@ho...> - 2003-03-20 14:29:15
|
I'm not educated in these standards really. With regards to C++ our company have our own. >From: David McKen <ci...@ya...> >Reply-To: ci...@ya... >To: Dev-C Mailing List <dev...@li...> >Subject: Re: [Dev-C++] C99 >Date: Thu, 20 Mar 2003 05:07:14 -0800 (PST) > >How would I check? > >(The standard you mean? Not exactly sure. How different is >it from standard C?) > > >--- Ioannis Vranos <iv...@em...> wrote: > > Has anyone learned C99? I want just to check C99 > > penetration on the public > > (I suspect its towards 0). > > > > > > > > > > Regards, > > > > Ioannis Vranos > > > > * Programming pages: http://www.noicys.freeurl.com > > * Alternative URL: http://run.to/noicys > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Does your code think > > in ink? > > You could win a Tablet PC. Get a free Tablet PC hat just > > for playing. > > What are you waiting for? > > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > >===== >Signed >David Mcken > >Life Sucks >Live with it > >__________________________________________________ >Do you Yahoo!? >Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! >http://platinum.yahoo.com > > >------------------------------------------------------- >This SF.net email is sponsored by: Tablet PC. >Does your code think in ink? You could win a Tablet PC. >Get a free Tablet PC hat just for playing. What are you waiting for? >http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Use MSN Messenger to send music and pics to your friends http://messenger.msn.co.uk |
|
From: Ioannis V. <iv...@em...> - 2003-03-20 14:20:18
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Roberto Ricardi > Sent: Thursday, March 20, 2003 5:44 AM > To: 'Dev-C++ -Users-List' > Subject: [Dev-C++] Lost with 4.9.7.x and ... headers and=20 > using name std; >=20 >=20 > Hi all, >=20 > Im lost with Dev-C++ 4.9.7.x and ... compiler or linker ? results >=20 > I had work well lately using: >=20 > #include <stdio.h> > #include <stdlib.h> > #include <string.h> > #include <time.h> /* Non portable header files */ > #include <conio.h> > #include <dos.h> > #include <math.h> /* You know that's non-portable, I just want to e consistent with my = above remarks :) */ > #include <windows.h> /* The first is C++ header file, the second an outdated one. They are = NOT C. In fact they are *illegal* in C */ > #include <cstdlib.h> > #include <iostream.h> Namespaces do not exist in C. Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys |
|
From: Ioannis V. <iv...@em...> - 2003-03-20 14:15:16
|
Ugly, stupid and dangerous. In C it should be if(currentParser==NULL), in C++ (ifcurrentParser==0). Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Somanathan Kaimal Sent: Thursday, March 20, 2003 12:58 PM To: 'dev...@li...' Subject: [Dev-C++] FW: What does this mean ? Hi Techies, if (!currentParser) currentParser = parserList.getInstance(); ** if (currentParser == (MegacoParser *)0) { SWERR aSwerr; aSwerr.record(__FILE__, __LINE__, "Error: No Parser available."); return MegacoDefs::fail; } How does the line marked with * different from If(currentParser == 0) Thanks in adv Somanathan |
|
From: Ioannis V. <iv...@em...> - 2003-03-20 14:11:59
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of swagat kumar > Sent: Thursday, March 20, 2003 10:10 AM > To: dev...@li... > Subject: [Dev-C++] how to use "srand" > > > Hi! > friends...i have got a doubt... > > how to use srand() function. how to define the seed for this. > suppose i want to generate a random number between 0 and 10. > then what seed should i use... > > though rand() function works fine....i just wanted to know > the difference beween srand() and rand()... Rand() defines a pseudo-random sequence. Srand() defines the starting point based on a seed. So if you do not srand(), or srand() the same number you will always getting the same sequence. So, better do that: /* C */ #include <stdlib.h> #include <time.h> /* ... */ int x; /* initialize only once */ srand(time(NULL)); x=rand(); /* ... */ x=rand(); /* etc */ Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys |
|
From: Ioannis V. <iv...@in...> - 2003-03-20 14:09:26
|
-----------------------Original Message-----------------------
>From: Andr=E9 Mac=E1rio Barros [mailto:and...@su...]
>To: Dev-Cpp-Users [mailto:dev...@li...]
>Date: 14/3/2003 3:31:00 =F0=EC
>Subject: [Dev-C++] Correct use of pointers
>
>Gentlemen,
>
> Even in the Ritchie=B4s books sometimes I fount .C codes using "wild
>pointers" or something
>like:
>****************
>void main()
=20
int main()
>{
> int *p, a, b;
>
> a=3D2;
> b=3D3;
> *p =3D a + b;
>
> ...
>}
>****************
The above is a mistake. I do not recall something like that in K&R2. Are
you sure it is not written something like this?:
int p[10], a, b;
a=3D2;
b=3D3;
*p=3Da+b;
>But... in large programs we can have problems.
>
> Would I be corret, allways, if I use insted a code like:
>*********************
>#include <stdlib.h> /* or alloc.h */
>
>void main()
>{
> int *p, a, b;
>
> p=3Dmalloc(1*sizeof(int));
> a=3D2;
> b=3D3;
> *p =3D a + b;
> ...
> free(p);
>}
>******************
>1. It=B4s not necessary, but is it tecnically correct?
It is correct and required. malloc() could be used like this:
p=3Dmalloc(sizeof(int));
or
p=3Dmalloc(sizeof(*p));
>2. Is there any point, where the previous memory allocation is mandatory=
?
=20
ALWAYS.
Ioannis Vranos=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL: http://run.to/noicys=20
|
|
From: Per W. <pw...@ia...> - 2003-03-20 13:53:01
|
wxWindows contains an encapsulation looking very much like pThreads. It works on most OS. /Per W On Thu, 20 Mar 2003, David McKen wrote: > I am assisting with a project that I believe will benifit > from the use of threads. However the group that I am > working with does not want tolose portability just to get > threads. What portable thread packages are avalible and are > there any success stories that anyone on the list has had > with these various packages. > > Thanks in advance > David McKen > > __________________________________________________ > Do you Yahoo!? > Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! > http://platinum.yahoo.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: Tablet PC. > Does your code think in ink? You could win a Tablet PC. > Get a free Tablet PC hat just for playing. What are you waiting for? > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |