dev-cpp-users Mailing List for Dev-C++ (Page 656)
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: Daniel G. <sp...@ho...> - 2001-10-21 23:37:53
|
<html><div style='background-color:'><DIV>
<P>phew thanks mate!!! code now reads</P>
<P>#include <stdio.h></P>
<P>int main()</P>
<P>{<BR> int a,b,c;</P>
<P> printf("Input number");</P>
<P> scanf("%d",&a); /* %d is for an int I think in C. &a assigns that value to a */<BR> <BR> c = a-1;<BR> <BR> b = 1;<BR> while (c >= 1) </P>
<P> {<BR> <BR> <BR> b = b*a--;<BR> c--;<BR> <BR> <BR> <BR> }<BR> printf ("The factoral is %d\n", b );<BR> return 0;<BR>}</P>
<P><BR>Thanks so much!!!!!!!!!!!!!!!!<BR><BR></P></DIV>
<DIV></DIV>
<DIV></DIV>>From: "Jason Hardman" <JAS...@BT...>
<DIV></DIV>>To: "Dev-C++" <DEV...@LI...>, "Daniel Glenfield" <SP...@HO...>
<DIV></DIV>>Subject: Re: [Dev-C++] factorial code additional
<DIV></DIV>>Date: Mon, 22 Oct 2001 00:24:22 +0100
<DIV></DIV>>
<DIV></DIV>>As long as it works that's the main thing. You might want to test it with the value 1.. remember that the factorial of 1 is 1.
<DIV></DIV>>
<DIV></DIV>>Jason.
<DIV></DIV>> ----- Original Message -----
<DIV></DIV>> From: Daniel Glenfield
<DIV></DIV>> To: jas...@bt... ; dev...@li...
<DIV></DIV>> Sent: Monday, October 22, 2001 12:16 AM
<DIV></DIV>> Subject: Re: [Dev-C++] factorial code additional
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> Here's what I ended up doing.
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> #include <STDIO.H>
<DIV></DIV>>
<DIV></DIV>> int main()
<DIV></DIV>>
<DIV></DIV>> {
<DIV></DIV>> int a,b,c;
<DIV></DIV>>
<DIV></DIV>> printf("Input number");
<DIV></DIV>>
<DIV></DIV>> scanf("%d",&a); /* %d is for an int I think in C. &a assigns that value to a */
<DIV></DIV>>
<DIV></DIV>> c = a-1;
<DIV></DIV>> b = a*c;
<DIV></DIV>> c--;
<DIV></DIV>> while (c >= 1)
<DIV></DIV>>
<DIV></DIV>> {
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> b = b*c--;
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> }
<DIV></DIV>> printf ("The factoral of %d is %d\n", a, b );
<DIV></DIV>> return 0;
<DIV></DIV>> }
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> But thanks, I'll look over yours :)
<DIV></DIV>>
<DIV></DIV>> >From: "Jason Hardman"
<DIV></DIV>> >To: "Daniel Glenfield"
<DIV></DIV>> >Subject: Re: [Dev-C++] factorial code additional
<DIV></DIV>> >Date: Mon, 22 Oct 2001 00:05:51 +0100
<DIV></DIV>> >
<DIV></DIV>> >I'm not sure what you mean about it having 3 variables, but here is a version that works. Note that I have created a factorial function. I'm not entirly sure what you were doing in your version, but you forgot to store the variables you were working with, and didn't initialse b to anything. If you perform a calculation you have to assign it's result to something.
<DIV></DIV>> >
<DIV></DIV>> >#include
<DIV></DIV>> >#include
<DIV></DIV>> >
<DIV></DIV>> >inline int factorial(int n);
<DIV></DIV>> >
<DIV></DIV>> >int main(int argc, char *argv[])
<DIV></DIV>> >{
<DIV></DIV>> > int a, b;
<DIV></DIV>> > printf("Input number: ");
<DIV></DIV>> > scanf("%d", &a);
<DIV></DIV>> >
<DIV></DIV>> > // calculate factorial here
<DIV></DIV>> > b = factorial(a);
<DIV></DIV>> >
<DIV></DIV>> > printf("The factoral of %d is %d\n", a, b);
<DIV></DIV>> >
<DIV></DIV>> > system("PAUSE");
<DIV></DIV>> > return 0;
<DIV></DIV>> >}
<DIV></DIV>> >
<DIV></DIV>> >// factorial function
<DIV></DIV>> >inline int factorial(int n)
<DIV></DIV>> >{
<DIV></DIV>> > int r = 1;
<DIV></DIV>> > for(; n > 1; r *= n, --n);
<DIV></DIV>> > return r;
<DIV></DIV>> >}
<DIV></DIV>> >
<DIV></DIV>> >If you wanted to do the same with while loop then you could use:
<DIV></DIV>> >
<DIV></DIV>> >b = 1; // first initialise b
<DIV></DIV>> >while(a > 1)
<DIV></DIV>> >{
<DIV></DIV>> > b = b * a--; // or b *= a--;
<DIV></DIV>> >}
<DIV></DIV>> >
<DIV></DIV>> >I hope from that you can figure out what you were doing wrong. The only reason to bring in a third variable would be to avoid changing 'a', and then you would just assign 'a' to a temporary variable i.e. 't' and then operate on it. Note that you don't need to multiply by 1 so it's 'a > 1' and not 'a >= 1', but it's a minor improvement.
<DIV></DIV>> >
<DIV></DIV>> >Jason.
<DIV></DIV>> > ----- Original Message -----
<DIV></DIV>> > From: Daniel Glenfield
<DIV></DIV>> > To: dev...@li...
<DIV></DIV>> > Sent: Sunday, October 21, 2001 11:00 PM
<DIV></DIV>> > Subject: [Dev-C++] factorial code additional
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> > what is wrong?
<DIV></DIV>> > I want to get the factorial of any number inputted
<DIV></DIV>> > It must have three veriables btw
<DIV></DIV>> >
<DIV></DIV>> > #include
<DIV></DIV>> > int main()
<DIV></DIV>> > /* This is a program which calculates the factorial of a number */
<DIV></DIV>> > {
<DIV></DIV>> > int a,b;
<DIV></DIV>> > printf("Input number");
<DIV></DIV>> > scanf("%d",&a
<DIV></DIV>> > while (a >= 1)
<DIV></DIV>> > {
<DIV></DIV>> > a*(a--);
<DIV></DIV>> > b = a;
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> > }
<DIV></DIV>> > printf ("The factoral is %d\n", b );
<DIV></DIV>> > return 0;
<DIV></DIV>> > }
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >------------------------------------------------------------------------------
<DIV></DIV>> > Get your FREE download of MSN Explorer at http://explorer.msn.com
<DIV></DIV>> > _______________________________________________ Dev-cpp-users mailing list Dev...@li... https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>------------------------------------------------------------------------------
<DIV></DIV>> Get your FREE download of MSN Explorer at http://explorer.msn.com
<DIV></DIV>> _______________________________________________ Dev-cpp-users mailing list Dev...@li... https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
<DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html>
|
|
From: Jason H. <jas...@bt...> - 2001-10-21 23:24:34
|
As long as it works that's the main thing. You might want to test it =
with the value 1.. remember that the factorial of 1 is 1.
Jason.
----- Original Message -----=20
From: Daniel Glenfield=20
To: jas...@bt... ; dev...@li... =
Sent: Monday, October 22, 2001 12:16 AM
Subject: Re: [Dev-C++] factorial code additional
Here's what I ended up doing.
#include <stdio.h>
int main()
{
int a,b,c;
printf("Input number");
scanf("%d",&a); /* %d is for an int I think in C. &a assigns =
that value to a */
=20
c =3D a-1;
b =3D a*c;
c--;
while (c >=3D 1)=20
{
=20
=20
b =3D b*c--;
=20
=20
=20
}
printf ("The factoral of %d is %d\n", a, b );
return 0;
}
But thanks, I'll look over yours :)
>From: "Jason Hardman"=20
>To: "Daniel Glenfield"=20
>Subject: Re: [Dev-C++] factorial code additional=20
>Date: Mon, 22 Oct 2001 00:05:51 +0100=20
>=20
>I'm not sure what you mean about it having 3 variables, but here is a =
version that works. Note that I have created a factorial function. I'm =
not entirly sure what you were doing in your version, but you forgot to =
store the variables you were working with, and didn't initialse b to =
anything. If you perform a calculation you have to assign it's result to =
something.=20
>=20
>#include=20
>#include=20
>=20
>inline int factorial(int n);=20
>=20
>int main(int argc, char *argv[])=20
>{=20
> int a, b;=20
> printf("Input number: ");=20
> scanf("%d", &a);=20
>=20
> // calculate factorial here=20
> b =3D factorial(a);=20
>=20
> printf("The factoral of %d is %d\n", a, b);=20
>=20
> system("PAUSE");=20
> return 0;=20
>}=20
>=20
>// factorial function=20
>inline int factorial(int n)=20
>{=20
> int r =3D 1;=20
> for(; n > 1; r *=3D n, --n);=20
> return r;=20
>}=20
>=20
>If you wanted to do the same with while loop then you could use:=20
>=20
>b =3D 1; // first initialise b=20
>while(a > 1)=20
>{=20
> b =3D b * a--; // or b *=3D a--;=20
>}=20
>=20
>I hope from that you can figure out what you were doing wrong. The =
only reason to bring in a third variable would be to avoid changing 'a', =
and then you would just assign 'a' to a temporary variable i.e. 't' and =
then operate on it. Note that you don't need to multiply by 1 so it's 'a =
> 1' and not 'a >=3D 1', but it's a minor improvement.=20
>=20
>Jason.=20
> ----- Original Message -----=20
> From: Daniel Glenfield=20
> To: dev...@li...=20
> Sent: Sunday, October 21, 2001 11:00 PM=20
> Subject: [Dev-C++] factorial code additional=20
>=20
>=20
> what is wrong?=20
> I want to get the factorial of any number inputted=20
> It must have three veriables btw=20
>=20
> #include=20
> int main()=20
> /* This is a program which calculates the factorial of a number */=20
> {=20
> int a,b;=20
> printf("Input number");=20
> scanf("%d",&a=20
> while (a >=3D 1)=20
> {=20
> a*(a--);=20
> b =3D a;=20
>=20
>=20
> }=20
> printf ("The factoral is %d\n", b );=20
> return 0;=20
> }=20
>=20
>=20
>=20
=
>------------------------------------------------------------------------=
------=20
> Get your FREE download of MSN Explorer at http://explorer.msn.com=20
> _______________________________________________ Dev-cpp-users =
mailing list Dev...@li... =
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users=20
-------------------------------------------------------------------------=
-----
Get your FREE download of MSN Explorer at http://explorer.msn.com
_______________________________________________ Dev-cpp-users mailing =
list Dev...@li... =
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Jason H. <jas...@bt...> - 2001-10-21 23:20:52
|
Minor update to the factorial function.
// factorial function
inline int factorial(int n)
{
int r =3D 1;
for(; n > 1; r *=3D n--);
return r;
}
When testing a function I expand out things like post-increments to =
avoid confusion and problems. It doesn't matter much as they both still =
work. This is just a minor style improvement in my eyes. :)
Jason.
|
|
From: Daniel G. <sp...@ho...> - 2001-10-21 23:16:50
|
<html><div style='background-color:'><DIV>
<P>Here's what I ended up doing.</P>
<P> </P>
<P>#include <stdio.h></P>
<P>int main()</P>
<P>{<BR> int a,b,c;</P>
<P> printf("Input number");</P>
<P> scanf("%d",&a); /* %d is for an int I think in C. &a assigns that value to a */<BR> <BR> c = a-1;<BR> b = a*c;<BR> c--;<BR> while (c >= 1) </P>
<P> {<BR> <BR> <BR> b = b*c--;<BR> <BR> <BR> <BR> }<BR> printf ("The factoral of %d is %d\n", a, b );<BR> return 0;<BR>}</P>
<P><BR><BR><BR>But thanks, I'll look over yours :)</P></DIV>
<DIV></DIV>
<DIV></DIV>>From: "Jason Hardman" <JAS...@BT...>
<DIV></DIV>>To: "Daniel Glenfield" <SP...@HO...>
<DIV></DIV>>Subject: Re: [Dev-C++] factorial code additional
<DIV></DIV>>Date: Mon, 22 Oct 2001 00:05:51 +0100
<DIV></DIV>>
<DIV></DIV>>I'm not sure what you mean about it having 3 variables, but here is a version that works. Note that I have created a factorial function. I'm not entirly sure what you were doing in your version, but you forgot to store the variables you were working with, and didn't initialse b to anything. If you perform a calculation you have to assign it's result to something.
<DIV></DIV>>
<DIV></DIV>>#include <CSTDLIB>
<DIV></DIV>>#include <CSTDIO>
<DIV></DIV>>
<DIV></DIV>>inline int factorial(int n);
<DIV></DIV>>
<DIV></DIV>>int main(int argc, char *argv[])
<DIV></DIV>>{
<DIV></DIV>> int a, b;
<DIV></DIV>> printf("Input number: ");
<DIV></DIV>> scanf("%d", &a);
<DIV></DIV>>
<DIV></DIV>> // calculate factorial here
<DIV></DIV>> b = factorial(a);
<DIV></DIV>>
<DIV></DIV>> printf("The factoral of %d is %d\n", a, b);
<DIV></DIV>>
<DIV></DIV>> system("PAUSE");
<DIV></DIV>> return 0;
<DIV></DIV>>}
<DIV></DIV>>
<DIV></DIV>>// factorial function
<DIV></DIV>>inline int factorial(int n)
<DIV></DIV>>{
<DIV></DIV>> int r = 1;
<DIV></DIV>> for(; n > 1; r *= n, --n);
<DIV></DIV>> return r;
<DIV></DIV>>}
<DIV></DIV>>
<DIV></DIV>>If you wanted to do the same with while loop then you could use:
<DIV></DIV>>
<DIV></DIV>>b = 1; // first initialise b
<DIV></DIV>>while(a > 1)
<DIV></DIV>>{
<DIV></DIV>> b = b * a--; // or b *= a--;
<DIV></DIV>>}
<DIV></DIV>>
<DIV></DIV>>I hope from that you can figure out what you were doing wrong. The only reason to bring in a third variable would be to avoid changing 'a', and then you would just assign 'a' to a temporary variable i.e. 't' and then operate on it. Note that you don't need to multiply by 1 so it's 'a > 1' and not 'a >= 1', but it's a minor improvement.
<DIV></DIV>>
<DIV></DIV>>Jason.
<DIV></DIV>> ----- Original Message -----
<DIV></DIV>> From: Daniel Glenfield
<DIV></DIV>> To: dev...@li...
<DIV></DIV>> Sent: Sunday, October 21, 2001 11:00 PM
<DIV></DIV>> Subject: [Dev-C++] factorial code additional
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> what is wrong?
<DIV></DIV>> I want to get the factorial of any number inputted
<DIV></DIV>> It must have three veriables btw
<DIV></DIV>>
<DIV></DIV>> #include <STDIO.H>
<DIV></DIV>> int main()
<DIV></DIV>> /* This is a program which calculates the factorial of a number */
<DIV></DIV>> {
<DIV></DIV>> int a,b;
<DIV></DIV>> printf("Input number");
<DIV></DIV>> scanf("%d",&a
<DIV></DIV>> while (a >= 1)
<DIV></DIV>> {
<DIV></DIV>> a*(a--);
<DIV></DIV>> b = a;
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> }
<DIV></DIV>> printf ("The factoral is %d\n", b );
<DIV></DIV>> return 0;
<DIV></DIV>> }
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>------------------------------------------------------------------------------
<DIV></DIV>> Get your FREE download of MSN Explorer at http://explorer.msn.com
<DIV></DIV>> _______________________________________________ Dev-cpp-users mailing list Dev...@li... https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
<DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html>
|
|
From: Jason H. <jas...@bt...> - 2001-10-21 23:11:40
|
I'm not sure what you mean about it having 3 variables, but here is a =
version that works. Note that I have created a factorial function. I'm =
not entirly sure what you were doing in your version, but you forgot to =
store the variables you were working with, and didn't initialse b to =
anything. If you perform a calculation you have to assign it's result to =
something.
#include <cstdlib>
#include <cstdio>
inline int factorial(int n);
int main(int argc, char *argv[])
{
int a, b;
printf("Input number: ");
scanf("%d", &a);
=20
// calculate factorial here
b =3D factorial(a);
printf("The factoral of %d is %d\n", a, b);
=20
system("PAUSE");
return 0;
}
// factorial function
inline int factorial(int n)
{
int r =3D 1;
for(; n > 1; r *=3D n, --n);
return r;
}
If you wanted to do the same with while loop then you could use:
b =3D 1; // first initialise b
while(a > 1)=20
{
b =3D b * a--; // or b *=3D a--;
}
I hope from that you can figure out what you were doing wrong. The only =
reason to bring in a third variable would be to avoid changing 'a', and =
then you would just assign 'a' to a temporary variable i.e. 't' and then =
operate on it. Note that you don't need to multiply by 1 so it's 'a > 1' =
and not 'a >=3D 1', but it's a minor improvement.
Jason.
----- Original Message -----=20
From: Daniel Glenfield=20
To: dev...@li...=20
Sent: Sunday, October 21, 2001 11:00 PM
Subject: [Dev-C++] factorial code additional
what is wrong?
I want to get the factorial of any number inputted
It must have three veriables btw
#include <stdio.h>
int main()
/* This is a program which calculates the factorial of a number */
{
int a,b;
printf("Input number");
scanf("%d",&a
while (a >=3D 1)=20
{
a*(a--);
b =3D a;
=20
=20
}
printf ("The factoral is %d\n", b );
return 0;
}
-------------------------------------------------------------------------=
-----
Get your FREE download of MSN Explorer at http://explorer.msn.com
_______________________________________________ Dev-cpp-users mailing =
list Dev...@li... =
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Jason H. <jas...@bt...> - 2001-10-21 22:36:07
|
You are getting those errors because cout is part of the <iostream> header.
<stdio> is used in C as opposed to C++ and the equivalent would be to use
printf(...)
Just add:
#include <iostream>
at the top.
Jason.
----- Original Message -----
From: "Christiaan Scholtz" <ck...@ia...>
To: <dev...@li...>
Sent: Sunday, October 21, 2001 11:17 PM
Subject: [Dev-C++] Errors reported in perfect code!
> This for example:
>
> #include <stdio.h>
>
> int main(int argc, char *argv[])
> {
> cout >> "hey";
> return 0;
> }
>
> gives :
>
> c:\mydocu~1\untitl~1.cpp: In function `int main(int, char **)':
>
> c:\mydocu~1\untitl~1.cpp:5: `cout' undeclared (first use this function)
>
> c:\mydocu~1\untitl~1.cpp:5: (Each undeclared identifier is reported only
> once
>
> c:\mydocu~1\untitl~1.cpp:5: for each function it appears in.)
>
>
>
> Whats going on here? I also get diffrent messages for larger code with
> nothing wrong with it.
>
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Christiaan S. <ck...@ia...> - 2001-10-21 22:18:55
|
This for example:
#include <stdio.h>
int main(int argc, char *argv[])
{
cout >> "hey";
return 0;
}
gives :
c:\mydocu~1\untitl~1.cpp: In function `int main(int, char **)':
c:\mydocu~1\untitl~1.cpp:5: `cout' undeclared (first use this function)
c:\mydocu~1\untitl~1.cpp:5: (Each undeclared identifier is reported only
once
c:\mydocu~1\untitl~1.cpp:5: for each function it appears in.)
Whats going on here? I also get diffrent messages for larger code with
nothing wrong with it.
|
|
From: Jason H. <jas...@bt...> - 2001-10-21 22:10:29
|
Is this just your belief or can you prove that this is the case from some external referece or knowledgable party (other than yourself)? As I have been given to understand it the case of there only being one set of methods existing in memory for a class, and then each method being passed a hidden pointer to the object is the true case. Hence the existence of the "this" pointer for use in a class. I would also like to mention that the way you would have it is unecessarily wasteful of resources. The issue becomes more complex with virtual methods and such, but I won't go into that right now. I wouldn't mind if someone else who is reading this discussion, and is knowledgable about the subject, putting us both on the correct path. Jason. ----- Original Message ----- From: "Ioannis Vranos" <no...@ya...> To: "Dev-C++" <dev...@li...> Sent: Sunday, October 21, 2001 3:14 PM Subject: RE: [Dev-C++] Strange effect Yes, when we create an object all member functions are being (re)created for that particual object. >do you believe that there are only a single set of methods for every object of a type, and the objects only contain the data? No. |
|
From: Jason H. <jas...@bt...> - 2001-10-21 22:02:38
|
Hi, your problem is that you are mixing up the string header for the C =
string functions i.e. strlen(), strcat(), etc... and that for the string =
object which is part of C++.
#include <string>
Is the one you want. Note the lack of the ".h"; this has become standard =
in C++. Also <string.h> and <cstring> (no ".h") are the same header.... =
well, almost but it makes no difference in the current mingw version. =
All the old style C headers i.e. <stdlib.h> <stdio.h> have now been =
moved on to the new form in C++ i.e. <cstdlib> <cstdio>, and the old =
form is depreciated, but still usable at the current time.
Basically you can just delete all the .h's off the includes in your code =
below.
Jason.
----- Original Message -----=20
From: Daniel Anderson=20
To: dev...@li...=20
Sent: Sunday, October 21, 2001 6:38 PM
Subject: [Dev-C++] using strings
Hello,
A seemingly simple problem has stumped me so far. I cannot figure out =
how to use simple strings in my programs. Do I need to add the =
<cstring.h> library? If so, my compiler says it can't find it- can I =
download this somewhere? I know I can get around this problem by using =
an array of chars, but I want to be able to use strings. I am using Dev =
4.01 and the mingw compiler 2.95.2-1. A thousand thanks for any help.
D
When I try to compile this program, I can a 'string' undeclared (first =
use this function) error.
// start
#include <iostream>
#include <iomanip> // For setw()
#include <fstream> // For file I/O
#include <string>
using namespace std;
int main()
{=20
string s1;
char pause;
cin >> s1;
cout << endl << s1 << endl;
cout << "pause";
cin >> pause;
return 0;
}
|
|
From: Daniel G. <sp...@ho...> - 2001-10-21 22:00:43
|
<html><div style='background-color:'><DIV>
<DIV>
<DIV>what is wrong?</DIV>
<DIV>I want to get the factorial of any number inputted</DIV>
<DIV>It must have three veriables btw</DIV>
<DIV> </DIV>
<DIV>#include <stdio.h></DIV>
<DIV>int main()<BR>/* This is a program which calculates the factorial of a number */<BR>{<BR> int a,b;</DIV>
<DIV> printf("Input number");</DIV>
<DIV> scanf("%d",&a</DIV>
<DIV> while (a >= 1) </DIV>
<DIV> {</DIV>
<DIV> a*(a--);<BR> b = a;<BR> <BR> <BR> }<BR> printf ("The factoral is %d\n", b );<BR> return 0;<BR>}<BR></DIV></DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html>
|
|
From: Daniel G. <sp...@ho...> - 2001-10-21 21:58:36
|
<html><div style='background-color:'><DIV>what is wrong?</DIV>
<DIV>I want to get the factorial of any number inputted</DIV>
<DIV> </DIV>
<DIV>#include <stdio.h></DIV>
<DIV>int main()<BR>/* This is a program which calculates the factorial of a number */<BR>{<BR> int a,b;</DIV>
<DIV> printf("Input number");</DIV>
<DIV> scanf("%d",&a</DIV>
<DIV> while (a >= 1) </DIV>
<DIV> {</DIV>
<DIV> a*(a--);<BR> b = a;<BR> <BR> <BR> }<BR> printf ("The factoral is %d\n", b );<BR> return 0;<BR>}<BR></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html>
|
|
From: Daniel A. <bt...@ca...> - 2001-10-21 17:24:41
|
Hello,
A seemingly simple problem has stumped me so far. I cannot figure out =
how to use simple strings in my programs. Do I need to add the =
<cstring.h> library? If so, my compiler says it can't find it- can I =
download this somewhere? I know I can get around this problem by using =
an array of chars, but I want to be able to use strings. I am using Dev =
4.01 and the mingw compiler 2.95.2-1. A thousand thanks for any help.
D
When I try to compile this program, I can a 'string' undeclared (first =
use this function) error.
// start
#include <iostream.h>
#include <iomanip.h> // For setw()
#include <fstream.h> // For file I/O
#include <string.h>
using namespace std;
int main()
{=20
string s1;
char pause;
cin >> s1;
cout << endl << s1 << endl;
cout << "pause";
cin >> pause;
return 0;
}
|
|
From: Ioannis V. <no...@ya...> - 2001-10-21 13:17:12
|
I forgot to mention that *static* member functions have only one instance for all the objects of a class. Non-static member functions are created each one for an object, that is any object has its own *instance* of each non-static member function. =20 =20 =20 Ioannis =20 * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/>=20 * Alternative URL: http://run.to/noicys -----Original Message----- From: Jason Hardman [mailto:jas...@bt...]=20 Sent: Sunday, October 21, 2001 2:00 PM To: Ioannis Vranos Subject: Re: [Dev-C++] Strange effect It seems you don't understand what I am explaining. Do you believe that each time you create an object of a particular class you are recreating a set of methods specifically for that object? Or do you believe that there are only a single set of methods for every object of a type, and the objects only contain the data? Note that there is a distinction between an object and a class. When you report the size of the A and C objects note that A is 1 byte and C is 2 bytes, which is constistent with the two char's that are declared. If a method code was also part of the object then the values would be much bigger. =20 Note that you are actualy over running the A object in your code and accessing undefined memory when you access b, but it doesn't cause any errors because of the way memory is managed by the compiler. I expect that if larger data was used then problems would crop up. =20 I might try again to get across the idea again later, because I still think it aproaches the truth of the situation. If you want you can report the error to the team that develop gcc and see what they say, they will know better than either of us. =20 I'm sure we'll discuss this some more but I'll leave it there for now. =20 Jason. ----- Original Message -----=20 From: Ioannis Vranos <mailto:no...@ya...> =20 To: Dev-C++ <mailto:dev...@li...> =20 Sent: Sunday, October 21, 2001 12:21 PM Subject: RE: [Dev-C++] Strange effect Jason, i strongly disagree with you. :) Each object has its *own* member functions and no external function is passed to them in anyway. That's why the cost of calling a member function is smaller than the cost of calling an external function. For accuracy, the compiler should behave as if this happens. :) Compiler can optimize its way as it likes as far as it follows this behavior. In our case C class is derived from A, so a C object contains a A object. Also we have public inheritance which means that all methods of A are accessible within C if not overided.=20 A C object has bigger size than a A object. Here we have a A object not a C object. If we could do these kinds of things we could create base class objects cast them to their derived types and have derived objects doing the same things having smaller size (=3Dmiracle). In our case my theory is that this happens: The compiler trying to produce even smaller size than it would in normal situation, creates common instances of member functions. Here it gets confused by the casting and a mess is created. =20 Proof that this is a compiler defect: =20 #include <iostream> =20 class A { public: char a; void test() { a=3D'A'; } }; =20 class C: public A { public: char b; void test() { a=3D'C'; b=3D'D'; } }; =20 =20 =20 int main() { using namespace std; =20 A a; =20 C *cp=3Dstatic_cast<C *>(&a); =20 cp->test(); =20 cout<<"a=3D "<<cp->a<<" b=3D "<<cp->b<<endl; =20 cout<<"sizeof(A)=3D "<<sizeof(A)<<" sizeof(C)=3D "<<sizeof(C)<<endl; } =20 =20 Ioannis =20 * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/>=20 * Alternative URL: http://run.to/noicys =20 -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Jason Hardman Sent: Sunday, October 21, 2001 1:20 AM To: Dev-C++ Subject: Re: [Dev-C++] Strange effect Hi, I'm back now. I've just been to see a great Depeche Mode concert (WOW!). =20 As I mentioned I was writing the explanation of what I think is really happening quickly. I'll try again and see if it comes out right. =20 You have two classes one derived from the other, the derived class has a method that overrides one in the base. In other words two methods with the same name but different implementations. Now pretend that the two methods are actually *two* functions which are passed a pointer to a struct of some sort, which is basically how a method is implemented (don't complain, it's an analogy). When you turn pointer to the base type into an pointer to the derived type, even if it isn't a derived object, then you are telling the compiler that you want to use the object as a derived type. So when you call a method via that pointer the compiler thinks that you are really using a derived object and will try to find the correct function. Because both the functions have the same name, it will find a "test" function and pass the "this" pointer to that function that belongs to derived type, even though the "this" really points to a base object. =20 I hope you are following me so far? I understand the idea in my head but it's not easy for me to explain properly. Both the functions (methods) do something, however they don't try to access anything through the "this" pointer. That means that you won't get any problems like you would if you tried accessing something that doesn't exist in base, but is expected of derived. =20 So all that happens is the derived "test" function is called and passed a pointer it doesn't use. The function is hard coded to print out "C" in this case. =20 That is the why (AFAICT) what happens, happens. Whether the compiler should complain I don't know, it depends upon what the standard says about this case. It's only the fact that the two methods have the same name that let's this work the way it does. =20 Does all this scan? I am pretty certain that this is what is happening internally. =20 If C wasn't derived from A and you managed to cast A into C then, in theory at least, you would get the same result. Note I have not tested this. I think maybe that static_cast would not allow it to happen, so a reinterpret_cast would be needed. This is just a thought, and may not be an actual truth. =20 Regards, Jason. |
|
From: Ioannis V. <no...@ya...> - 2001-10-21 13:13:01
|
-----Original Message-----
From: Jason Hardman [mailto:jas...@bt...]=20
Sent: Sunday, October 21, 2001 2:00 PM
To: Ioannis Vranos
Subject: Re: [Dev-C++] Strange effect
>It seems you don't understand what I am explaining. Do you believe that
each time you create an object of a particular class you are=20
>recreating a set of methods specifically for that object? Or=20
Yes, when we create an object all member functions are being (re)created
for that particual object.
>do you believe that there are only a single set of methods for every
object of a type, and the objects only contain the data?=20
No.
>Note that there is a distinction between an object and a class. When
you report the size of the A and C objects note that A is 1 byte
>and C is 2 bytes, which is constistent with the two char's that are
declared. If a method code was also part of the object then the values=20
>would be much bigger.
>
>Note that you are actualy over running the A object in your code and
accessing undefined memory when you access b, but it doesn't=20
>cause any errors because of the way memory is managed by the compiler.
I expect that if larger data was used then problems would=20
>crop up.
Nope, because the whole thing is a compiler defect.=20
>I might try again to get across the idea again later, because I still
think it aproaches the truth of the situation. If you want you can=20
>report the error to the team that develop gcc and see what they say,
they will know better than either of us.
>I'm sure we'll discuss this some more but I'll leave it there for now.
What happens here is that the compiler creates a C object at the place
of the A object. That is a mess and here is the proof. Run this code to
see yourself!:
#include <iostream>
=20
class A
{
public:
char a;
void test() { a=3D'A'; }
};
=20
class C: public A
{
public:
char b;
void test() { a=3D'C'; b=3D'D'; }
};
=20
=20
=20
int main()
{
using namespace std;
=20
A a;
=20
C *cp=3Dstatic_cast<C *>(&a);
=20
cp->test();
=20
cout<<"a=3D "<<cp->a<<" b=3D "<<cp->b<<endl;
=20
cout<<"sizeof(a)=3D "<<sizeof(a)<<" sizeof(*cp)=3D =
"<<sizeof(*cp)<<endl;
cout<<"Address of a=3D "<<&a<<" Address of *cp=3D "<<cp<<endl;
}
It outputs:
C:\c>temp
a=3D C b=3D D
sizeof(a)=3D 1 sizeof(*cp)=3D 2
Address of a=3D 0x241ff5f Address of *cp=3D 0x241ff5f
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
|
|
From: Ioannis V. <no...@ya...> - 2001-10-21 10:20:18
|
Jason, i strongly disagree with you. :) Each object has its *own* member
functions and no external function is passed to them in anyway. That's
why the cost of calling a member function is smaller than the cost of
calling an external function. For accuracy, the compiler should behave
as if this happens. :) Compiler can optimize its way as it likes as far
as it follows this behavior. In our case C class is derived from A, so a
C object contains a A object. Also we have public inheritance which
means that all methods of A are accessible within C if not overided.=20
A C object has bigger size than a A object. Here we have a A object not
a C object. If we could do these kinds of things we could create base
class objects cast them to their derived types and have derived objects
doing the same things having smaller size (=3Dmiracle).
In our case my theory is that this happens: The compiler trying to
produce even smaller size than it would in normal situation, creates
common instances of member functions. Here it gets confused by the
casting and a mess is created.
=20
Proof that this is a compiler defect:
=20
#include <iostream>
=20
class A
{
public:
char a;
void test() { a=3D'A'; }
};
=20
class C: public A
{
public:
char b;
void test() { a=3D'C'; b=3D'D'; }
};
=20
=20
=20
int main()
{
using namespace std;
=20
A a;
=20
C *cp=3Dstatic_cast<C *>(&a);
=20
cp->test();
=20
cout<<"a=3D "<<cp->a<<" b=3D "<<cp->b<<endl;
=20
cout<<"sizeof(A)=3D "<<sizeof(A)<<" sizeof(C)=3D "<<sizeof(C)<<endl;
}
=20
=20
Ioannis
=20
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
<http://www.noicys.f2s.com/>=20
* Alternative URL: http://run.to/noicys
=20
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Jason
Hardman
Sent: Sunday, October 21, 2001 1:20 AM
To: Dev-C++
Subject: Re: [Dev-C++] Strange effect
Hi, I'm back now. I've just been to see a great Depeche Mode concert
(WOW!).
=20
As I mentioned I was writing the explanation of what I think is really
happening quickly. I'll try again and see if it comes out right.
=20
You have two classes one derived from the other, the derived class has a
method that overrides one in the base. In other words two methods with
the same name but different implementations. Now pretend that the two
methods are actually *two* functions which are passed a pointer to a
struct of some sort, which is basically how a method is implemented
(don't complain, it's an analogy). When you turn pointer to the base
type into an pointer to the derived type, even if it isn't a derived
object, then you are telling the compiler that you want to use the
object as a derived type. So when you call a method via that pointer the
compiler thinks that you are really using a derived object and will try
to find the correct function. Because both the functions have the same
name, it will find a "test" function and pass the "this" pointer to that
function that belongs to derived type, even though the "this" really
points to a base object.
=20
I hope you are following me so far? I understand the idea in my head but
it's not easy for me to explain properly. Both the functions (methods)
do something, however they don't try to access anything through the
"this" pointer. That means that you won't get any problems like you
would if you tried accessing something that doesn't exist in base, but
is expected of derived.
=20
So all that happens is the derived "test" function is called and passed
a pointer it doesn't use. The function is hard coded to print out "C" in
this case.
=20
That is the why (AFAICT) what happens, happens. Whether the compiler
should complain I don't know, it depends upon what the standard says
about this case. It's only the fact that the two methods have the same
name that let's this work the way it does.
=20
Does all this scan? I am pretty certain that this is what is happening
internally.
=20
If C wasn't derived from A and you managed to cast A into C then, in
theory at least, you would get the same result. Note I have not tested
this. I think maybe that static_cast would not allow it to happen, so a
reinterpret_cast would be needed. This is just a thought, and may not be
an actual truth.
=20
Regards, Jason.
|
|
From: Julio L. <ju2...@ya...> - 2001-10-21 00:58:14
|
I cant figure out why the last if statment in the
changeCells function causes a crash....need help
//towersofhanoi3.hpp
class Ring
{
public:
Ring()
{
thisRing= new char[26];
}
virtual ~Ring()
{
delete [] thisRing;
}
virtual void setRing(char
ring[26]){strcpy(thisRing, ring);}
virtual char* getRing() const{ return thisRing;}
private:
char *thisRing;
};
class groupRings: public Ring
{
public:
groupRings()
{
for(int i=0; i<11; i++)
pRings[i]= new Ring;
pRings[0]->setRing(" *3*
");
pRingsL[0]= 3;
pRings[1]->setRing(" **5**
");
pRingsL[1]= 5;
pRings[2]->setRing(" ***7***
");
pRingsL[2]= 7;
pRings[3]->setRing(" ****9****
");
pRingsL[3]= 9;
pRings[4]->setRing(" ****11*****
");
pRingsL[4]= 11;
pRings[5]->setRing(" *****13******
");
pRingsL[5]= 13;
pRings[6]->setRing(" ******15*******
");
pRingsL[6]= 15;
pRings[7]->setRing(" *******17********
");
pRingsL[7]= 17;
pRings[8]->setRing(" ********19*********
");
pRingsL[8]= 19;
pRings[9]->setRing(" *********21**********
");
pRingsL[9]= 21;
pRings[10]->setRing("
");
pRingsL[10]= 26;
}
~groupRings(){ delete [] pRings;}
char* getRings(unsigned short int i) const{ return
pRings[i-1]->getRing();}
int getRingL(unsigned short int i) const{return
pRingsL[i-1];}
private:
Ring *pRings[11];
int pRingsL[11];
};
class Board
{
public:
Board()
{
for(int column=0; column<3; column++)
for(int row=0; row<26; row++)
pbCell[column][row]= new char [26];
}
~Board()
{
delete [] pbCell;
}
void setCell(int column, int row, char ring[26]){
strcpy(pbCell[column-1][row-1], ring);}
char* getCell(int column, int row) const{return
pbCell[column-1][row-1];}
private:
char *pbCell[3][26];
};
//end towersofhanoi3.hpp
//towersofhanoi.cpp
#include <iostream.h>
#include <stdlib.h>
#include "towersofhanoi3.hpp"
void menu();
void infoTOH();
void aboutTOH();
void objectTOH();
void rulesTOH();
void demoGm();
void changeCells(unsigned short int, unsigned short
int, groupRings *, Board *);
void board4(Board *);
int main()
{
menu();
return 0;
}// end main()
void menu()
{
unsigned short int menuChoice;
bool exit= true;
Ring *pRings= new Ring;
Board *pBoard= new Board;
while(exit)
{
system("cls");
cout << "\n\n ***THE
TOWERS OF HANOI***\n\n\n";
cout << " (1)Info on THE
TOWERS OF HANOI\n";
cout << " (2)Demo\n";
cout << " (3)Play\n";
cout << " (4)Exit\n\n";
cout << " Enter Choice
#: ";
cin >> menuChoice;
switch(menuChoice)
{
case 1: infoTOH();
break;
case 2: demoGm();
break;
//case 3: play();
//break;
case 4: exit = false;
break;
default: exit = false;
break;
}//end switch()
}//end while()
delete pRings;
delete pBoard;
}//end menu()
void infoTOH()
{
unsigned short int infoChoice;
bool exit= true;
void (*infoFuncPntr)();
while(exit)
{
system("cls");
cout << "\n\n ***THE
TOWERS OF HANOI Info***\n\n\n";
cout << " (1) About
THE TOWERS OF HANOI\n";
cout << " (2) Object
of THE TOWERS OF HANOI\n";
cout << " (3) Rules of
THE TOWERS OF HANOI\n";
cout << " (4) Return
to Main Menu\n\n";
cout << " Enter
Choice #: ";
cin >> infoChoice;
switch(infoChoice)
{
case 1: infoFuncPntr= aboutTOH;
break;
case 2: infoFuncPntr= objectTOH;
break;
case 3: infoFuncPntr= rulesTOH;
break;
case 4: exit= false;
break;
default: exit= false;
break;
}//end switch()
if(exit != false)
infoFuncPntr();
//end if()
}//end while()
}//end infoTOH()
void aboutTOH()
{
system("cls");
cout << "\n\n ***About THE
TOWERS OF HANOI***\n\n\n";
cout << "The ancient puzzle of THE TOWERS OF HANOI
involves three pegs with numerous\n";
cout << "rings on the first peg. The rings are
arranged in increasing order of size,\n";
cout << "from top to bottm.\n\n";
system("PAUSE");
}
void objectTOH()
{
system("cls");
cout << "\n\n ***Object of
THE TOWERS OF HANOI***\n\n\n";
cout << "The objective of this puzzle is to move
all the rings from the third peg to\n";
cout << "the first peg in the original order that
they began in.\n\n";
system("PAUSE");
}
void rulesTOH()
{
system("cls");
cout << "\n\n ***Rules of
THE TOWERS OF HANOI***\n\n\n";
cout << "The rules are that only one ring may be
moved at a time and that a larger ring\n";
cout << "may never be placed on a smaller
ring.\n\n";
system("PAUSE");
}
void demoGm() //Shows how to win a four ring game
{
groupRings *pRings= new groupRings;
Board *pBoard= new Board;
for(int column= 1; column<3; column++)
for(int row= 1; row<11; row++)
pBoard->setCell(column, row,
pRings->getRings(11));
for(int column= 3; column<4; column++)
for(int row= 1, ring= 9; row<5; row++, ring--)
pBoard->setCell(column, row,
pRings->getRings(ring));
for(int column= 3; column<4; column++)
for(int row= 5; row<11; row++)
pBoard->setCell(column, row,
pRings->getRings(11));
system("cls");
cout << "\n\n
***Demo Game***\n\n\n";
cout << " *4 Ring
Game*\n";
cout << " *No Moves
Made*\n\n";
board4(pBoard);
system("PAUSE");
system("cls");
changeCells(3, 2, pRings, pBoard);
cout << "\n\n
***Demo Game***\n\n\n";
cout << " *4 Ring
Game*\n";
cout << " *One Move
Made*\n\n";
board4(pBoard);
system("PAUSE");
system("cls");
delete pRings;
delete pBoard;
}
void changeCells(unsigned short int fromColumn,
unsigned short int toColumn, groupRings * rRings,
Board *rBoard)
{
unsigned short int fromRow, toRow, fromRingNum,
toRingNum;
bool compareFrom, compareTo, findFromRing,
findToRing;
if(fromColumn != toColumn)
{
//Find first ring that is not empty in from
column
for(int i= 11; i>0; i--)
{
compareFrom=
strcmp(rBoard->getCell(fromColumn, i),
rRings->getRings(11));
if(compareFrom == 1)
{
fromRow= i;
break;
}//end if(compareFrom)
if(compareFrom == 0 && i == 1)
{
fromRow= 1;
}//end if
}//end for i
//Find first ring that is not empty in to
column
for(int i=11; i>0; i--)
{
compareTo=
strcmp(rBoard->getCell(toColumn, i),
rRings->getRings(11));
if(compareTo == 1)
{
toRow= i;
break;
}//end if(compareTo)
if(compareTo == 0 && i == 1)
{
toRow= 1;
}//end if
}//end for i
//Find the ring length of first non empty ring
in from column
for(int i=10; i>0; i--)
{
findFromRing=
strcmp(rBoard->getCell(fromColumn, fromRow),
rRings->getRings(i));
if(findFromRing == 0)
{
fromRingNum = i;
break;
}//end if(findFromRing)
}//end for i
//Find the ring length of first non empty ring
in to column
for(int i=10; i>0; i--)
{
findToRing=
strcmp(rBoard->getCell(toColumn, toRow),
rRings->getRings(i));
if(findToRing == 0)
{
toRingNum = i;
break;
}//end if(findToRing)
}//end for i
//If to column ring length is greater than the
from column ring length
//then move the ring from the from column to
the to column above
if(rRings->getRingL(toRingNum) >
rRings->getRingL(fromRingNum))
{
rBoard->setCell(toColumn, toRow+1,
rRings->getRings(fromRingNum));
rBoard->setCell(fromColumn, fromRow,
rRings->getRings(11));
}//end if(to ring > from ring)
}//end if(from != to)
}//end changeCells
void board4(Board *rBoard)
{
cout << "
-----------------------------------------------------------------------------\n";
cout << "| |
| |\n";
cout << "| | | |
| | |\n";
cout << "|" << rBoard->getCell(1,4) << "|" <<
rBoard->getCell(2,4) << "|" << rBoard->getCell(3,4) <<
"|\n";
cout << "| | | |
| | |\n";
cout << "|" << rBoard->getCell(1,3) << "|" <<
rBoard->getCell(2,3) << "|" << rBoard->getCell(3,3) <<
"|\n";
cout << "| | | |
| | |\n";
cout << "|" << rBoard->getCell(1,2) << "|" <<
rBoard->getCell(2,2) << "|" << rBoard->getCell(3,2) <<
"|\n";
cout << "| | | |
| | |\n";
cout << "|" << rBoard->getCell(1,1) << "|" <<
rBoard->getCell(2,1) << "|" << rBoard->getCell(3,1) <<
"|\n";
cout << "| | | |
| | |\n";
cout << "
-----------------------------------------------------------------------------\n\n";
}
=====
Julio
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
|
|
From: Jason H. <jas...@bt...> - 2001-10-20 23:22:07
|
MessageHi, I'm back now. I've just been to see a great Depeche Mode = concert (WOW!). As I mentioned I was writing the explanation of what I think is really = happening quickly. I'll try again and see if it comes out right. You have two classes one derived from the other, the derived class has a = method that overrides one in the base. In other words two methods with = the same name but different implementations. Now pretend that the two = methods are actually *two* functions which are passed a pointer to a = struct of some sort, which is basically how a method is implemented = (don't complain, it's an analogy). When you turn pointer to the base = type into an pointer to the derived type, even if it isn't a derived = object, then you are telling the compiler that you want to use the = object as a derived type. So when you call a method via that pointer the = compiler thinks that you are really using a derived object and will try = to find the correct function. Because both the functions have the same = name, it will find a "test" function and pass the "this" pointer to that = function that belongs to derived type, even though the "this" really = points to a base object. I hope you are following me so far? I understand the idea in my head but = it's not easy for me to explain properly. Both the functions (methods) = do something, however they don't try to access anything through the = "this" pointer. That means that you won't get any problems like you = would if you tried accessing something that doesn't exist in base, but = is expected of derived. So all that happens is the derived "test" function is called and passed = a pointer it doesn't use. The function is hard coded to print out "C" in = this case. That is the why (AFAICT) what happens, happens. Whether the compiler = should complain I don't know, it depends upon what the standard says = about this case. It's only the fact that the two methods have the same = name that let's this work the way it does. Does all this scan? I am pretty certain that this is what is happening = internally. If C wasn't derived from A and you managed to cast A into C then, in = theory at least, you would get the same result. Note I have not tested = this. I think maybe that static_cast would not allow it to happen, so a = reinterpret_cast would be needed. This is just a thought, and may not be = an actual truth. Regards, Jason. ----- Original Message -----=20 From: Ioannis Vranos=20 To: Dev-C++=20 Sent: Saturday, October 20, 2001 7:38 PM Subject: RE: [Dev-C++] Strange effect At first, this result comes from both dev-c++ and bcc32. We should not = see "C!" even if the member functions were virtual since we have an = object A, not C assigned to A * (that's why a dynamic_cast would fail). = Also every object has (must have) its own member function so there is = not "only one method in memory" as you mention. Yours is the case of = *static* member functions. Probably we have here some compiler = optimization being confused by casting. This is definately a compiler = defect(for both of them). Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... = [mailto:dev...@li...] On Behalf Of Jason = Hardman Sent: Saturday, October 20, 2001 6:49 PM To: Dev-C++ Subject: Re: [Dev-C++] Strange effect AFAICT a static_cast will always be able to cast a pointer from a = base into a derived type without checking if it's OK to do so as = dynamic_cast would. Also of note is that the methods are not virtual, so the test in C = would hide the test in A. And as neither objects contains any data then = there is no real difference between them. If I had more time I would try = out a few things, like making the methods virtual and adding variables = to the objects, i.e. private: int data; initialised differently in each = object, with a getter function the same in each class. When multiple instances of an object is created there is still only = one method in memory, which is passed a this pointer to the object it is = operating on. So in the case of this example there are two methods = defined, and when you cast into the C type the compiler directs to the C = method as opposed to the A method. If you tried to access data that = existed in C but not A then you would get errors. I hope I have explained that OK. I'm rushing a little as I'm going = out in a minute. Jason. ----- Original Message -----=20 From: Ioannis Vranos=20 To: Dev-C++=20 Sent: Saturday, October 20, 2001 6:24 PM Subject: [Dev-C++] Strange effect Strange effect. Consider the code:=20 #include <iostream> class A { public: void test() { std::cout<<"A!\n"; } }; class C: public A { public: void test() { std::cout<<"C!\n"; } }; int main() { using namespace std; =20 A a; =20 C *cp=3Dstatic_cast<C *>(&a); =20 cp->test(); } It produces C:\c>temp C! Isn't this wrong? I expected either a GPF or garbage, or even "A!" = but not "C!". Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys |
|
From: Ioannis V. <no...@ya...> - 2001-10-20 21:52:48
|
My last note on the matter is i want to reinforce that, yes you are *right*, strcat() places the new string at the first occurence of '\0' of its first argument (=3Dit behaves as if it searches character by character from the beginning for '\0') because i used the term "probably" in my previous email regarding the matter. Also as i said "string\0" is looking for trouble in our code.=20 That doesn't mean that strcat() searches character by character for 0 but it *behaves* as if it does that. The same way that pointers *behave* as if they store a memory address, string literals *behave* as null terminated const char arrays, e.t.c.. This is important for all to keep in mind. :) This behavior is required by the standard, but it doesn't mean things happen this way. But it is safe to think of them as working this way. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf=20 > Of Jason Hardman > Sent: Saturday, October 20, 2001 1:38 AM > To: Dev-C++ > Subject: Re: [Dev-C++] Errorhandling >=20 >=20 > As defined in C/C++ Programmers Reference: >=20 > strcat > ------ > #include <string.h> > char *strcat(char *str1, const char *str2); >=20 > The strcat() function concatenates a copy of str2 to str1 and > terminates str1 with a null. The null terminator originally=20 > ending str1 is overwritten by the first character of str2.=20 > The string str2 is untouched by the operation. If the arrays=20 > overlap, the behavior of strcat() is undefined. >=20 > In C99, str1 and str2 are qualified by restrict. >=20 > The strcat() function returns str1. >=20 > Remember, no bounds checking takes place, so it is the > programmer's responsibility to ensure that str1 is large=20 > enough to hold both its original contents and also those of str2. > ------------------------ >=20 > The function strcat() is defined in the C, and therefore the > C++, standard. It must follow a consistent behaviour. It is > feasible that it could have been written in assembler, but it > will still have the same basic behaviour. I know it would be=20 > slow in large strings, but there isn't really any faster and=20 > reliable way to search for the null. Skipping characters=20 > opens up the possibility of missing the proper null, and=20 > accessing characters after it which will be undefined. In=20 > strcat you might not overrun the array containing the string=20 > that way, but in a similar function such as strlen you=20 > probably would, and that would be an access violation. >=20 > Without more information about the string being passed then > you are pretty much limited to going throught the string from=20 > start to finish. Generally if a programmer was dealing with=20 > very large string then it would be wise for him/her to find a=20 > better way of dealing with them (such as tracking the=20 > length), or to just accept the performance hit. >=20 > Whether the include is an on/off switch or a header won't > change the way the function works, just how the compiler adds=20 > it to the exe. >=20 > Regards, Jason. >=20 > PS: Yet again I've probably gone OTT (Over The Top). LOL! It > looks like I've written an essay on a standard function. >=20 > PPS: Why is it us to always seem to be arguing over silly > little things like this? >=20 >=20 > _______________________________________________ > Dev-cpp-users mailing list Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 |
|
From: Ioannis V. <no...@ya...> - 2001-10-20 21:19:44
|
This line is being executed till it meets EOF: while ((c =3D getc(input)) !=3D EOF) That means it is being executed until you press ctrl-z in windows systems. If you want to be executed per input try using '\n' too. This is how it worked for me: C:\c>temp sdaff ^Z n =3D 6 stdin C:\c> Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Luigi Santillo > Sent: Saturday, October 20, 2001 4:14 PM > To: dev...@li... > Subject: [Dev-C++] possible bug of MinGW compiler >=20 >=20 > Hi all, >=20 > I tried the small program named "test.exe" (source is "test.c" and is=20 > attached to this message) using the file "in.txt" (also=20 > attached) as its input. >=20 > I have used the MinGW compiler shipped with Dev-C++ 4.0 (the=20 > output of the=20 > command: "gcc -v" says "gcc version 2.95.2 19991024=20 > (release)"), to build=20 > the executable on a Win98 SE equipped system. >=20 > To my surprise, I found that when the input of "test.exe"=20 > comes "directly"=20 > from stdin (I mean without redirection) there is no output!=20 > As usual on DOS=20 > systems, I used Ctrl+z to type EOF. >=20 > The program works as expected when input comes from a file or=20 > "indirectly"=20 > from stdin. >=20 > Is there something wrong in the program or is it a bug of the=20 > compiler? >=20 > Thank you for your attention. >=20 > -- > gisan > gi...@li... >=20 |
|
From: Luigi S. <gi...@li...> - 2001-10-20 18:25:20
|
Hi all, I tried the small program named "test.exe" (source is "test.c" and is attached to this message) using the file "in.txt" (also attached) as its input. I have used the MinGW compiler shipped with Dev-C++ 4.0 (the output of the command: "gcc -v" says "gcc version 2.95.2 19991024 (release)"), to build the executable on a Win98 SE equipped system. To my surprise, I found that when the input of "test.exe" comes "directly" from stdin (I mean without redirection) there is no output! As usual on DOS systems, I used Ctrl+z to type EOF. The program works as expected when input comes from a file or "indirectly" from stdin. Is there something wrong in the program or is it a bug of the compiler? Thank you for your attention. -- gisan gi...@li... |
|
From: Ioannis V. <no...@ya...> - 2001-10-20 17:36:41
|
At first, this result comes from both dev-c++ and bcc32. We should not see "C!" even if the member functions were virtual since we have an object A, not C assigned to A * (that's why a dynamic_cast would fail). Also every object has (must have) its own member function so there is not "only one method in memory" as you mention. Yours is the case of *static* member functions. Probably we have here some compiler optimization being confused by casting. This is definately a compiler defect(for both of them). =20 =20 Ioannis =20 * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/>=20 * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Jason Hardman Sent: Saturday, October 20, 2001 6:49 PM To: Dev-C++ Subject: Re: [Dev-C++] Strange effect AFAICT a static_cast will always be able to cast a pointer from a base into a derived type without checking if it's OK to do so as dynamic_cast would. =20 Also of note is that the methods are not virtual, so the test in C would hide the test in A. And as neither objects contains any data then there is no real difference between them. If I had more time I would try out a few things, like making the methods virtual and adding variables to the objects, i.e. private: int data; initialised differently in each object, with a getter function the same in each class. =20 When multiple instances of an object is created there is still only one method in memory, which is passed a this pointer to the object it is operating on. So in the case of this example there are two methods defined, and when you cast into the C type the compiler directs to the C method as opposed to the A method. If you tried to access data that existed in C but not A then you would get errors. =20 I hope I have explained that OK. I'm rushing a little as I'm going out in a minute. =20 Jason. ----- Original Message -----=20 From: Ioannis Vranos <mailto:no...@ya...> =20 To: Dev-C++ <mailto:dev...@li...> =20 Sent: Saturday, October 20, 2001 6:24 PM Subject: [Dev-C++] Strange effect Strange effect. Consider the code:=20 =20 #include <iostream> =20 class A { public: void test() { std::cout<<"A!\n"; } }; =20 class C: public A { public: void test() { std::cout<<"C!\n"; } }; =20 =20 =20 int main() { using namespace std; =20 A a; =20 C *cp=3Dstatic_cast<C *>(&a); =20 cp->test(); =20 } =20 =20 It produces =20 C:\c>temp C! =20 Isn't this wrong? I expected either a GPF or garbage, or even "A!" but not "C!". =20 =20 Ioannis =20 * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/>=20 * Alternative URL: http://run.to/noicys =20 |
|
From: Jason H. <jas...@bt...> - 2001-10-20 16:49:16
|
MessageAFAICT a static_cast will always be able to cast a pointer from a =
base into a derived type without checking if it's OK to do so as =
dynamic_cast would.
Also of note is that the methods are not virtual, so the test in C would =
hide the test in A. And as neither objects contains any data then there =
is no real difference between them. If I had more time I would try out a =
few things, like making the methods virtual and adding variables to the =
objects, i.e. private: int data; initialised differently in each object, =
with a getter function the same in each class.
When multiple instances of an object is created there is still only one =
method in memory, which is passed a this pointer to the object it is =
operating on. So in the case of this example there are two methods =
defined, and when you cast into the C type the compiler directs to the C =
method as opposed to the A method. If you tried to access data that =
existed in C but not A then you would get errors.
I hope I have explained that OK. I'm rushing a little as I'm going out =
in a minute.
Jason.
----- Original Message -----=20
From: Ioannis Vranos=20
To: Dev-C++=20
Sent: Saturday, October 20, 2001 6:24 PM
Subject: [Dev-C++] Strange effect
Strange effect. Consider the code:=20
#include <iostream>
class A
{
public:
void test() { std::cout<<"A!\n"; }
};
class C: public A
{
public:
void test() { std::cout<<"C!\n"; }
};
int main()
{
using namespace std;
=20
A a;
=20
C *cp=3Dstatic_cast<C *>(&a);
=20
cp->test();
}
It produces
C:\c>temp
C!
Isn't this wrong? I expected either a GPF or garbage, or even "A!" but =
not "C!".
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
|
|
From: Ioannis V. <no...@ya...> - 2001-10-20 16:22:49
|
Strange effect. Consider the code:=20
=20
#include <iostream>
=20
class A
{
public:
void test() { std::cout<<"A!\n"; }
};
=20
class C: public A
{
public:
void test() { std::cout<<"C!\n"; }
};
=20
=20
=20
int main()
{
using namespace std;
=20
A a;
=20
C *cp=3Dstatic_cast<C *>(&a);
=20
cp->test();
=20
}
=20
=20
It produces
=20
C:\c>temp
C!
=20
Isn't this wrong? I expected either a GPF or garbage, or even "A!" but
not "C!".
=20
=20
Ioannis
=20
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
<http://www.noicys.f2s.com/>=20
* Alternative URL: http://run.to/noicys
=20
|
|
From: Jason H. <jas...@bt...> - 2001-10-20 12:55:19
|
OK then that's agreed. And I admit I did once use sizeof to determine the length of a string array, but only cos it was a string of constant length, although I can't remember if I created it as a constant string. I shall never transgress again. ;-D I wonder if the original poster has been paying any attention to us two. I hope at least he has learnt that you don't need to null terminate a string literal by hand. Jason. ----- Original Message ----- From: "Ioannis Vranos" <no...@ya...> To: "Dev-C++" <dev...@li...> Sent: Saturday, October 20, 2001 12:30 PM Subject: RE: [Dev-C++] Errorhandling At first, we do not argue we discuss. It is fun to discuss for C and C++. :) Anyway, the standard doesn't say that it looks character after character (compiler has its own internal memory management and it may mark large blocks of memory with length numbers and stuff: read the 8th chapter of K&R 2 and in particular 8.7 where it has an implementation of malloc) but you are probably right, it probably behaves as if it looks from character to character. But the main point here is that strcat(buffer, "a string\0"); is worthless and is looking for trouble. I am 100% sure that in certain occasions it means trouble. E.g. like you use sizeof on a char array to determine the length of the string and not strlen() as i saw in some email in this list. In summary using "string\0" shows lack of knowledge at least. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Jason Hardman > Sent: Saturday, October 20, 2001 1:38 AM > To: Dev-C++ > Subject: Re: [Dev-C++] Errorhandling > > > As defined in C/C++ Programmers Reference: > > strcat > ------ > #include <string.h> > char *strcat(char *str1, const char *str2); > > The strcat() function concatenates a copy of str2 to str1 and > terminates str1 with a null. The null terminator originally > ending str1 is overwritten by the first character of str2. > The string str2 is untouched by the operation. If the arrays > overlap, the behavior of strcat() is undefined. > > In C99, str1 and str2 are qualified by restrict. > > The strcat() function returns str1. > > Remember, no bounds checking takes place, so it is the > programmer's responsibility to ensure that str1 is large > enough to hold both its original contents and also those of str2. > ------------------------ > > The function strcat() is defined in the C, and therefore the > C++, standard. It must follow a consistent behaviour. It is > feasible that it could have been written in assembler, but it > will still have the same basic behaviour. I know it would be > slow in large strings, but there isn't really any faster and > reliable way to search for the null. Skipping characters > opens up the possibility of missing the proper null, and > accessing characters after it which will be undefined. In > strcat you might not overrun the array containing the string > that way, but in a similar function such as strlen you > probably would, and that would be an access violation. > > Without more information about the string being passed then > you are pretty much limited to going throught the string from > start to finish. Generally if a programmer was dealing with > very large string then it would be wise for him/her to find a > better way of dealing with them (such as tracking the > length), or to just accept the performance hit. > > Whether the include is an on/off switch or a header won't > change the way the function works, just how the compiler adds > it to the exe. > > Regards, Jason. > > PS: Yet again I've probably gone OTT (Over The Top). LOL! It > looks like I've written an essay on a standard function. > > PPS: Why is it us to always seem to be arguing over silly > little things like this? > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > _______________________________________________ Dev-cpp-users mailing list Dev...@li... https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Ioannis V. <no...@ya...> - 2001-10-20 10:28:40
|
At first, we do not argue we discuss. It is fun to discuss for C and C++. :) Anyway, the standard doesn't say that it looks character after character (compiler has its own internal memory management and it may mark large blocks of memory with length numbers and stuff: read the 8th chapter of K&R 2 and in particular 8.7 where it has an implementation of malloc) but you are probably right, it probably behaves as if it looks from character to character. But the main point here is that strcat(buffer, "a string\0"); is worthless and is looking for trouble. I am 100% sure that in certain occasions it means trouble. E.g. like you use sizeof on a char array to determine the length of the string and not strlen() as i saw in some email in this list. In summary using "string\0" shows lack of knowledge at least. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Jason Hardman > Sent: Saturday, October 20, 2001 1:38 AM > To: Dev-C++ > Subject: Re: [Dev-C++] Errorhandling >=20 >=20 > As defined in C/C++ Programmers Reference: >=20 > strcat > ------ > #include <string.h> > char *strcat(char *str1, const char *str2); >=20 > The strcat() function concatenates a copy of str2 to str1 and=20 > terminates str1 with a null. The null terminator originally=20 > ending str1 is overwritten by the first character of str2.=20 > The string str2 is untouched by the operation. If the arrays=20 > overlap, the behavior of strcat() is undefined. >=20 > In C99, str1 and str2 are qualified by restrict. >=20 > The strcat() function returns str1. >=20 > Remember, no bounds checking takes place, so it is the=20 > programmer's responsibility to ensure that str1 is large=20 > enough to hold both its original contents and also those of str2. > ------------------------ >=20 > The function strcat() is defined in the C, and therefore the=20 > C++, standard. It must follow a consistent behaviour. It is=20 > feasible that it could have been written in assembler, but it=20 > will still have the same basic behaviour. I know it would be=20 > slow in large strings, but there isn't really any faster and=20 > reliable way to search for the null. Skipping characters=20 > opens up the possibility of missing the proper null, and=20 > accessing characters after it which will be undefined. In=20 > strcat you might not overrun the array containing the string=20 > that way, but in a similar function such as strlen you=20 > probably would, and that would be an access violation. >=20 > Without more information about the string being passed then=20 > you are pretty much limited to going throught the string from=20 > start to finish. Generally if a programmer was dealing with=20 > very large string then it would be wise for him/her to find a=20 > better way of dealing with them (such as tracking the=20 > length), or to just accept the performance hit. >=20 > Whether the include is an on/off switch or a header won't=20 > change the way the function works, just how the compiler adds=20 > it to the exe. >=20 > Regards, Jason. >=20 > PS: Yet again I've probably gone OTT (Over The Top). LOL! It=20 > looks like I've written an essay on a standard function. >=20 > PPS: Why is it us to always seem to be arguing over silly=20 > little things like this? >=20 >=20 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 |