dev-cpp-users Mailing List for Dev-C++ (Page 590)
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: staale <st...@le...> - 2002-05-10 09:08:35
|
Ioannis and Helmut,
Out of curiosity I tried Ioannis's code in VC6++ SP4 (w2k-machine) , and
KDeveloper 2.0 (RedHat 7.2 - gcc 2.95.x ? ) and the results are:
VC6++ 936 kB
KDeveloper 8064 kB
For fun I tried it in VB and Powerbasic to:
VB6 4382 kB
PB 4309 kB
I'm still puzzeled by the big difference between the two Dev-C releases. The
only logical explenation is that it is posible to configure this somewhere.
Pleace enlighten me..:o)
Regards
Staale Flock
----- Original Message -----
From: "Ioannis Vranos" <no...@ho...>
To: "Dev-C++ Mailing List" <dev...@li...>
Sent: Friday, May 10, 2002 7:28 AM
Subject: RE: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has only access to
1MB memory.
>
> > -----Original Message-----
> > From: staale [mailto:st...@le...]
> > Sent: Friday, May 10, 2002 7:55 AM
> > To: Ioannis Vranos; Dev-C++ Mailing List
> > Subject: Re: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has
> > only access to 1MB memory.
> >
> >
> > Hi Ioannis,
> >
> > As I'm not a seasoned C++ programer I welcom your your work
> > on my code, and
> > your efforts in this mailing list.:o)
> >
> > To be shure I test again and with som simpler code and it
> > still fails on a
> > NT4-Sp6 (and w2k) with Dev-C 4.9.20 (Clean new installation
> > of the computer,
> > also the OS!!)
> >
> > I't works on a NT4-Sp6 with Dev-C 4.0
> >
> > See also the 'tread'
> > [Dev-C++] not enough memory - how to configure Win2000
> > which is the reaason form my involvement.
> >
> > ----------- Code -------------
> > #include <stdlib.h>
> >
> > int main()
> > {
> >
> > // 1MB = 1048576 = 1*1024*1024
> > // 2MB = 2097152 = 2*1024*1024
> > // 31MB = 32505856
> > char narr[2097152];
> >
> > system("PAUSE");
> > return 0;
> > }
> > ----------- Code End -------------
> >
> > Best Regards
> > Staale Flock
>
>
>
> I assume you mean that your code crashes, not the IDE.There is a limit
> of the stack. It has nothing to do with the compiler.
>
>
> Run this code to see the size of your stack:
>
> #include <iostream>
>
> void stack()
> {
> using namespace std;
>
> static unsigned long counter=0;
>
> char buffer[1024-sizeof(unsigned long)-1];
>
> counter++;
>
> cout<<"Allocated approximately "<<counter<<" KB of stack before i
> die\n";
>
> stack();
> }
>
>
>
> int main()
> {
> stack();
> }
>
>
> That's why for large arrays & objects we use the free store (new,
> delete) or better the standard library containers such as vector.
>
>
>
> Ioannis
>
> * Ioannis Vranos
> * Programming pages: http://www.noicys.cjb.net
> * Alternative URL: http://run.to/noicys
>
> _______________________________________________________________
>
> Have big pipes? SourceForge.net is looking for download mirrors. We supply
> the hardware. You get the recognition. Email Us: ban...@so...
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: staale <st...@le...> - 2002-05-10 07:53:08
|
Hi again Ioannis and Helmut,
Your sample code (yes the application crashes, not the IDE) died (stack
overflow) at Approximately 2002 kB on (Nt4-Sp6 - Dev-C 4.9.20).
On NT4-SP6 Dev-C 4.0 I got 32250 kB before I got a stack overflow error.
The w2k machine with first Dev-C 4.0 and then 4.9.20 installed got the stack
overflow at 2002 kB.
So we could conclude that the two versions of Dev-C (or rather accompanied
compilers) handels stack allocation differently?
Regards
Staale Flock
----- Original Message -----
From: "Ioannis Vranos" <no...@ho...>
To: "Dev-C++ Mailing List" <dev...@li...>
Sent: Friday, May 10, 2002 7:28 AM
Subject: RE: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has only access to
1MB memory.
>
> > -----Original Message-----
> > From: staale [mailto:st...@le...]
> > Sent: Friday, May 10, 2002 7:55 AM
> > To: Ioannis Vranos; Dev-C++ Mailing List
> > Subject: Re: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has
> > only access to 1MB memory.
> >
> >
> > Hi Ioannis,
> >
> > As I'm not a seasoned C++ programer I welcom your your work
> > on my code, and
> > your efforts in this mailing list.:o)
> >
> > To be shure I test again and with som simpler code and it
> > still fails on a
> > NT4-Sp6 (and w2k) with Dev-C 4.9.20 (Clean new installation
> > of the computer,
> > also the OS!!)
> >
> > I't works on a NT4-Sp6 with Dev-C 4.0
> >
> > See also the 'tread'
> > [Dev-C++] not enough memory - how to configure Win2000
> > which is the reaason form my involvement.
> >
> > ----------- Code -------------
> > #include <stdlib.h>
> >
> > int main()
> > {
> >
> > // 1MB = 1048576 = 1*1024*1024
> > // 2MB = 2097152 = 2*1024*1024
> > // 31MB = 32505856
> > char narr[2097152];
> >
> > system("PAUSE");
> > return 0;
> > }
> > ----------- Code End -------------
> >
> > Best Regards
> > Staale Flock
>
>
>
> I assume you mean that your code crashes, not the IDE.There is a limit
> of the stack. It has nothing to do with the compiler.
>
>
> Run this code to see the size of your stack:
>
> #include <iostream>
>
> void stack()
> {
> using namespace std;
>
> static unsigned long counter=0;
>
> char buffer[1024-sizeof(unsigned long)-1];
>
> counter++;
>
> cout<<"Allocated approximately "<<counter<<" KB of stack before i
> die\n";
>
> stack();
> }
>
>
>
> int main()
> {
> stack();
> }
>
>
> That's why for large arrays & objects we use the free store (new,
> delete) or better the standard library containers such as vector.
>
>
>
> Ioannis
>
> * Ioannis Vranos
> * Programming pages: http://www.noicys.cjb.net
> * Alternative URL: http://run.to/noicys
>
> _______________________________________________________________
>
> Have big pipes? SourceForge.net is looking for download mirrors. We supply
> the hardware. You get the recognition. Email Us: ban...@so...
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: <jar...@ig...> - 2002-05-10 06:44:31
|
On 10 May, Ioannis Vranos wrote: > >> -----Original Message----- >> From: staale [mailto:st...@le...] >> Sent: Friday, May 10, 2002 7:55 AM >> To: Ioannis Vranos; Dev-C++ Mailing List >> Subject: Re: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has >> only access to 1MB memory. >> > SNIP > > I assume you mean that your code crashes, not the IDE.There is a limit > of the stack. It has nothing to do with the compiler. Of course it has. E.g. all the mingw stuff is running nicely and I don't think gcc/g++ will run with such a small stack. Furthermore Staale only wrote a small test for locating the error. My primary failing programm (unfortunately much bigger) doesn't allocate big arrays on the stack. And why does Staale's program run under 4.0 ? Sorry for being harsh, but I have to say so. A C++ system which limits the stack to 0.001 Gb on machines which have 1-4 Gb nowadays is not uptodate. It's my feeling as well, that DevC++ 4.9.x generates 16 bits applications by default. > > Run this code to see the size of your stack: It would be better if there were a method to increase the stack size. It can't believe it's a Win2000 problem. Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik Institute of Technology, RWTH Aachen D 52056 Aachen, Germany |
|
From: Ioannis V. <no...@ho...> - 2002-05-10 05:28:47
|
> -----Original Message-----
> From: staale [mailto:st...@le...]
> Sent: Friday, May 10, 2002 7:55 AM
> To: Ioannis Vranos; Dev-C++ Mailing List
> Subject: Re: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has
> only access to 1MB memory.
>
>
> Hi Ioannis,
>
> As I'm not a seasoned C++ programer I welcom your your work
> on my code, and
> your efforts in this mailing list.:o)
>
> To be shure I test again and with som simpler code and it
> still fails on a
> NT4-Sp6 (and w2k) with Dev-C 4.9.20 (Clean new installation
> of the computer,
> also the OS!!)
>
> I't works on a NT4-Sp6 with Dev-C 4.0
>
> See also the 'tread'
> [Dev-C++] not enough memory - how to configure Win2000
> which is the reaason form my involvement.
>
> ----------- Code -------------
> #include <stdlib.h>
>
> int main()
> {
>
> // 1MB = 1048576 = 1*1024*1024
> // 2MB = 2097152 = 2*1024*1024
> // 31MB = 32505856
> char narr[2097152];
>
> system("PAUSE");
> return 0;
> }
> ----------- Code End -------------
>
> Best Regards
> Staale Flock
I assume you mean that your code crashes, not the IDE.There is a limit
of the stack. It has nothing to do with the compiler.
Run this code to see the size of your stack:
#include <iostream>
void stack()
{
using namespace std;
static unsigned long counter=0;
char buffer[1024-sizeof(unsigned long)-1];
counter++;
cout<<"Allocated approximately "<<counter<<" KB of stack before i
die\n";
stack();
}
int main()
{
stack();
}
That's why for large arrays & objects we use the free store (new,
delete) or better the standard library containers such as vector.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|
|
From: staale <st...@le...> - 2002-05-10 04:52:13
|
Hi Ioannis,
As I'm not a seasoned C++ programer I welcom your your work on my code, and
your efforts in this mailing list.:o)
To be shure I test again and with som simpler code and it still fails on a
NT4-Sp6 (and w2k) with Dev-C 4.9.20 (Clean new installation of the computer,
also the OS!!)
I't works on a NT4-Sp6 with Dev-C 4.0
See also the 'tread'
[Dev-C++] not enough memory - how to configure Win2000
which is the reaason form my involvement.
----------- Code -------------
#include <stdlib.h>
int main()
{
// 1MB = 1048576 = 1*1024*1024
// 2MB = 2097152 = 2*1024*1024
// 31MB = 32505856
char narr[2097152];
system("PAUSE");
return 0;
}
----------- Code End -------------
Best Regards
Staale Flock
----- Original Message -----
From: "Ioannis Vranos" <no...@ho...>
To: "Dev-C++ Mailing List" <dev...@li...>
Sent: Friday, May 10, 2002 4:51 AM
Subject: RE: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has only access to
1MB memory.
> Your code fixed:
>
> #include <iostream>
> file://-->Not needed
> // #include <stdio.h>
> #include <stdlib.h>
>
> file://--> You do not use argc, argv[] so why you declare them?
> int main(int argc, char *argv[])
> {
> using namespace std; // --> necessary
>
> const long MEGA_BYTE = 1024*1024;
>
> long nMBSize = 1;
>
> while (nMBSize != 0 ){
> cout << "Give MB size: ";
> cin >> nMBSize;
>
> file://--> Illegal in ANSI C++. The sizes of arrays in the stack must
be
> constants
> file://--> char narrBig[nMBSize * MEGA_BYTE];
>
> char *narrBig=new char[nMBSize*MEGA_BYTE];
>
>
> file://--> Useless. sizeof(char) is always 1 byte
> file://cout << "char size: " << sizeof(char) << " Bytes." << endl;
>
> file://-->You can't do that on an array on the free store.
> // Here it returns the size of char *
> // cout << "Array size: " << sizeof(narrBig)<< " Bytes." << endl;
> file://See if initializing each element makes a difference
> for (unsigned long i = 0; i<nMBSize*MEGA_BYTE;i++){
> narrBig[i] = 'A';
> }//i
> file://--> Useless. cout << "Array size: " << sizeof(narrBig) << endl;
> file://If you store objects in the array remember to use:
> delete [] narrBig;
> file://--> This could be disastrous when applied on a built in array as
you
> had done
>
>
> }//while (nMB..
> file://To have a breake before window closes, use:
> system("PAUSE");
> return 0;
> }
>
>
> ====
>
>
> How i would do it in your case:
>
>
> #include <iostream>
> #include <cstdlib>
> #include <vector>
>
>
> int main()
> {
> using namespace std;
>
> const unsigned long MEGA_BYTE = 1024*1024;
>
> long nMBSize;
>
> do
> {
> cout << "\nGive MB size: ";
> cin >> nMBSize;
>
> vector<char> narrBig(nMBSize*MEGA_BYTE);
>
> cout << "Array contents size: " << narrBig.size()<< " Bytes." <<
> endl;
>
> for (unsigned long i = 0; i<nMBSize*MEGA_BYTE;i++)
> narrBig[i] = 'A';
>
> cout << "Array contents size: " << narrBig.size()<< " Bytes." <<
> endl;
>
> // vector is destroyed at the end of its scope, and its contents are
> cleared
> }while (nMBSize!=0);
>
> file://To have a break before window closes, use:
> system("PAUSE");
>
> return 0;
> }
>
>
> Ioannis
>
> * Ioannis Vranos
> * Programming pages: http://www.noicys.cjb.net
> * Alternative URL: http://run.to/noicys
>
>
> > -----Original Message-----
> > From: dev...@li...
> > [mailto:dev...@li...] On Behalf Of staale
> > Sent: Friday, May 10, 2002 4:46 AM
> > To: jar...@be...; ha...@bl...; Dev-Cpp
> > Subject: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has only
> > access to 1MB memory.
> >
> >
> > Se also thread:
> > [Dev-C++] not enough memory - how to configure Win2000
> > on the mailing list. Test code below
> >
> > Hi Helmuth,
> >
> > Turns out this has somthing to do with Dev-C 4.9.20.
> >
> > This is what I did to verify the problem:
> > 1: Tried your file on both w2k (Clean system) or NT4-Sp6. It
> > failed on both
> > machins.
> >
> > 2: I installed DEV-C 4.9.20 (downloaded today) on a clean w2k
> > machine and
> > encountered the same problem when I compiled and ran the code.
> >
> > 3: Tried to uninstall DEV-C 4.9.20. Uninstal DOES NOT work.
> > Delete the fiels
> > manualy. Search for dev-c in regedit.exe and then run
> > RegClean.exe just
> > search for RegClean and you should be well of (Might not nead
> > this see pkt
> > 5)
> >
> > 4: Installed DEV-C 4.0 on the w2k machine Compiled and
> > tested OK to 31MB.
> >
> > 5: Installed Dev-c 4.9.20 on top of the 4.0 and It still
> > worked nicely..:o)
> >
> > 6: Installed Dev-C 4.9.20 on NT4-SP6 (Only Winzip appart from
> > OS). Added
> > shlwapi.dll and wininet.dll to system32 folder. Tried to run
> > the code but
> > no. Same failure.
> >
> > 7: Installed Dev-C 4.0 on top of the 4.9.20. This did not
> > help. Brobably
> > because both installers does not overwrite existing header
> > files (?). So you
> > should delete the 4.9.x installaation. Install 4.0 and then
> > 4.9.x (if you
> > nead it. It is a must if you want to use the wxWindows lib,
> > if I understand
> > right)
> >
> >
> > I'm not a seasoned C developer but would gues there are
> > somthing wrong with
> > a header file or reference making dev-c 4.9.x compile to
> > 16bit code(???)
> >
> > Best regards
> > Staale Flock
> >
> > ------------------- Code
> > Start --------------------------------------------------------
> > //////////////////////////////////////////////////////////////
> > //////////////
> > ///////////////////////////////////////////////////
> > // this code fails if you install Dev-C 4.9.20 on a new w2k
> > machine and try
> > to access
> > // more than 1MB memory. (Enter any number higher than 1).
> > //////////////////////////////////////////////////////////////
> > //////////////
> > ///////////////////////////////////////////////////
> >
> > #include <iostream>
> > #include <stdio.h>
> > #include <stdlib.h>
> >
> >
> > int main(int argc, char *argv[])
> > {
> > const long MEGA_BYTE = 1024*1024;
> > long nMBSize = 1;
> > while (nMBSize != 0 ){
> > cout << "Give MB size: ";
> > cin >> nMBSize;
> > char narrBig[nMBSize * MEGA_BYTE];
> > cout << "char size: " << sizeof(char) << " Bytes." << endl;
> > cout << "Array size: " << sizeof(narrBig)<< " Bytes." << endl;
> > file://See if initializing each element makes a difference
> > for (unsigned long i = 0; i<nMBSize*MEGA_BYTE;i++){
> > narrBig[i] = 'A';
> > }//i
> > cout << "Array size: " << sizeof(narrBig) << endl;
> > file://If you store objects in the array remember to use:
> > delete []narrBig;
> > }//while (nMB..
> > file://To have a breake before window closes, use:
> > system("PAUSE");
> > return 0;
> > }
> >
> > ------------------- Code end --------------------------------->
>
> _______________________________________________________________
>
> Have big pipes? SourceForge.net is looking for download mirrors. We supply
> the hardware. You get the recognition. Email Us: ban...@so...
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Ioannis V. <no...@ho...> - 2002-05-10 02:54:08
|
I know it is a religious issue, but what do you think of the idea to write Dev-C++ in C++? I guess more people would help to its development (also check Kernighan's text "why i do not like pascal"). Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Hongli Lai > Sent: Friday, May 10, 2002 3:29 AM > To: dev...@li... > Subject: Re: [Dev-C++] Dev-C++ 5 Beta 2 / Win98 > > > On Fri, 2002-05-10 at 01:30, Alfredo Cole wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > Hi: > > > > I have a project that I have been developing using Dev-C++ 4 and > > wxWindows 2.2.9. I have tried to compile the same project using > > version 5 Beta 2, adding the lines in Project Options that were not > > picked up by the new version, and I get "windres.exe can not find > > wx/msw/hand.cur". The file is where it's supposed to be, and > > reinstalling version 4 compiles the project again without any > > problems. What could be causing this problem? > > > > Thank you. > > > > I don't know about version 4, but WxWindows works correctly with the > latest development version of Dev-C++. > I will release a WxWindows package when Dev-C++ beta 3 is released. > > > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download > mirrors. We supply > the hardware. You get the recognition. Email Us: > ban...@so... > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Ioannis V. <no...@ho...> - 2002-05-10 02:52:05
|
Your code fixed:
#include <iostream>
//-->Not needed
// #include <stdio.h>
#include <stdlib.h>
//--> You do not use argc, argv[] so why you declare them?
int main(int argc, char *argv[])
{
using namespace std; // --> necessary
const long MEGA_BYTE = 1024*1024;
long nMBSize = 1;
while (nMBSize != 0 ){
cout << "Give MB size: ";
cin >> nMBSize;
//--> Illegal in ANSI C++. The sizes of arrays in the stack must be
constants
//--> char narrBig[nMBSize * MEGA_BYTE];
char *narrBig=new char[nMBSize*MEGA_BYTE];
//--> Useless. sizeof(char) is always 1 byte
//cout << "char size: " << sizeof(char) << " Bytes." << endl;
//-->You can't do that on an array on the free store.
// Here it returns the size of char *
// cout << "Array size: " << sizeof(narrBig)<< " Bytes." << endl;
//See if initializing each element makes a difference
for (unsigned long i = 0; i<nMBSize*MEGA_BYTE;i++){
narrBig[i] = 'A';
}//i
//--> Useless. cout << "Array size: " << sizeof(narrBig) << endl;
//If you store objects in the array remember to use:
delete [] narrBig;
//--> This could be disastrous when applied on a built in array as you
had done
}//while (nMB..
//To have a breake before window closes, use:
system("PAUSE");
return 0;
}
====
How i would do it in your case:
#include <iostream>
#include <cstdlib>
#include <vector>
int main()
{
using namespace std;
const unsigned long MEGA_BYTE = 1024*1024;
long nMBSize;
do
{
cout << "\nGive MB size: ";
cin >> nMBSize;
vector<char> narrBig(nMBSize*MEGA_BYTE);
cout << "Array contents size: " << narrBig.size()<< " Bytes." <<
endl;
for (unsigned long i = 0; i<nMBSize*MEGA_BYTE;i++)
narrBig[i] = 'A';
cout << "Array contents size: " << narrBig.size()<< " Bytes." <<
endl;
// vector is destroyed at the end of its scope, and its contents are
cleared
}while (nMBSize!=0);
//To have a break before window closes, use:
system("PAUSE");
return 0;
}
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf Of staale
> Sent: Friday, May 10, 2002 4:46 AM
> To: jar...@be...; ha...@bl...; Dev-Cpp
> Subject: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has only
> access to 1MB memory.
>
>
> Se also thread:
> [Dev-C++] not enough memory - how to configure Win2000
> on the mailing list. Test code below
>
> Hi Helmuth,
>
> Turns out this has somthing to do with Dev-C 4.9.20.
>
> This is what I did to verify the problem:
> 1: Tried your file on both w2k (Clean system) or NT4-Sp6. It
> failed on both
> machins.
>
> 2: I installed DEV-C 4.9.20 (downloaded today) on a clean w2k
> machine and
> encountered the same problem when I compiled and ran the code.
>
> 3: Tried to uninstall DEV-C 4.9.20. Uninstal DOES NOT work.
> Delete the fiels
> manualy. Search for dev-c in regedit.exe and then run
> RegClean.exe just
> search for RegClean and you should be well of (Might not nead
> this see pkt
> 5)
>
> 4: Installed DEV-C 4.0 on the w2k machine Compiled and
> tested OK to 31MB.
>
> 5: Installed Dev-c 4.9.20 on top of the 4.0 and It still
> worked nicely..:o)
>
> 6: Installed Dev-C 4.9.20 on NT4-SP6 (Only Winzip appart from
> OS). Added
> shlwapi.dll and wininet.dll to system32 folder. Tried to run
> the code but
> no. Same failure.
>
> 7: Installed Dev-C 4.0 on top of the 4.9.20. This did not
> help. Brobably
> because both installers does not overwrite existing header
> files (?). So you
> should delete the 4.9.x installaation. Install 4.0 and then
> 4.9.x (if you
> nead it. It is a must if you want to use the wxWindows lib,
> if I understand
> right)
>
>
> I'm not a seasoned C developer but would gues there are
> somthing wrong with
> a header file or reference making dev-c 4.9.x compile to
> 16bit code(???)
>
> Best regards
> Staale Flock
>
> ------------------- Code
> Start --------------------------------------------------------
> //////////////////////////////////////////////////////////////
> //////////////
> ///////////////////////////////////////////////////
> // this code fails if you install Dev-C 4.9.20 on a new w2k
> machine and try
> to access
> // more than 1MB memory. (Enter any number higher than 1).
> //////////////////////////////////////////////////////////////
> //////////////
> ///////////////////////////////////////////////////
>
> #include <iostream>
> #include <stdio.h>
> #include <stdlib.h>
>
>
> int main(int argc, char *argv[])
> {
> const long MEGA_BYTE = 1024*1024;
> long nMBSize = 1;
> while (nMBSize != 0 ){
> cout << "Give MB size: ";
> cin >> nMBSize;
> char narrBig[nMBSize * MEGA_BYTE];
> cout << "char size: " << sizeof(char) << " Bytes." << endl;
> cout << "Array size: " << sizeof(narrBig)<< " Bytes." << endl;
> //See if initializing each element makes a difference
> for (unsigned long i = 0; i<nMBSize*MEGA_BYTE;i++){
> narrBig[i] = 'A';
> }//i
> cout << "Array size: " << sizeof(narrBig) << endl;
> //If you store objects in the array remember to use:
> delete []narrBig;
> }//while (nMB..
> //To have a breake before window closes, use:
> system("PAUSE");
> return 0;
> }
>
> ------------------- Code end --------------------------------->
|
|
From: staale <st...@le...> - 2002-05-10 01:42:50
|
Se also thread:
[Dev-C++] not enough memory - how to configure Win2000
on the mailing list. Test code below
Hi Helmuth,
Turns out this has somthing to do with Dev-C 4.9.20.
This is what I did to verify the problem:
1: Tried your file on both w2k (Clean system) or NT4-Sp6. It failed on both
machins.
2: I installed DEV-C 4.9.20 (downloaded today) on a clean w2k machine and
encountered the same problem when I compiled and ran the code.
3: Tried to uninstall DEV-C 4.9.20. Uninstal DOES NOT work. Delete the fiels
manualy. Search for dev-c in regedit.exe and then run RegClean.exe just
search for RegClean and you should be well of (Might not nead this see pkt
5)
4: Installed DEV-C 4.0 on the w2k machine Compiled and tested OK to 31MB.
5: Installed Dev-c 4.9.20 on top of the 4.0 and It still worked nicely..:o)
6: Installed Dev-C 4.9.20 on NT4-SP6 (Only Winzip appart from OS). Added
shlwapi.dll and wininet.dll to system32 folder. Tried to run the code but
no. Same failure.
7: Installed Dev-C 4.0 on top of the 4.9.20. This did not help. Brobably
because both installers does not overwrite existing header files (?). So you
should delete the 4.9.x installaation. Install 4.0 and then 4.9.x (if you
nead it. It is a must if you want to use the wxWindows lib, if I understand
right)
I'm not a seasoned C developer but would gues there are somthing wrong with
a header file or reference making dev-c 4.9.x compile to 16bit code(???)
Best regards
Staale Flock
------------------- Code
Start --------------------------------------------------------
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////
// this code fails if you install Dev-C 4.9.20 on a new w2k machine and try
to access
// more than 1MB memory. (Enter any number higher than 1).
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
const long MEGA_BYTE = 1024*1024;
long nMBSize = 1;
while (nMBSize != 0 ){
cout << "Give MB size: ";
cin >> nMBSize;
char narrBig[nMBSize * MEGA_BYTE];
cout << "char size: " << sizeof(char) << " Bytes." << endl;
cout << "Array size: " << sizeof(narrBig)<< " Bytes." << endl;
//See if initializing each element makes a difference
for (unsigned long i = 0; i<nMBSize*MEGA_BYTE;i++){
narrBig[i] = 'A';
}//i
cout << "Array size: " << sizeof(narrBig) << endl;
//If you store objects in the array remember to use:
delete []narrBig;
}//while (nMB..
//To have a breake before window closes, use:
system("PAUSE");
return 0;
}
------------------- Code end ---------------------------------
----- Original Message -----
From: <jar...@be...>
To: <st...@le...>
Sent: Thursday, May 09, 2002 11:48 AM
Subject: Re: [Dev-C++] not enough memory - how to configure Win2000
> On 8 May, staale wrote:
> > I have tried my sample program on a w2k machine now and it work al the
way
> > up to 31 (thats wher you meet the long border is it not)?
> >
> > If you send me your compiled binary, I'll giv it a try. (hmm, could be
> > during thge weekend as I'm sceduled for the next 48 houers.:o) Also if
you
> > search for the drwtsn32.log file. Giv it a new name, delete it or what
ever.
> > Run the test program again. And then include the drwtsn32.log file in
your
> > mail to me. I might be able to help a litle bit more. The drwtsn32.log
is a
> > simpel debug dump file (I think www.sysinternals.com has an articel on
how
> > to read it).
> >
> > A thought, how do you start the program? From the Dev-C IDE or in a
console
> > window? If you use start-run-command.exe I belive you will be runing a
nativ
> > DOS session. You should use start-run-cmd.exe (don't nead the exe part)
to
> > get flat memmory. The last is what you get if you double click the
> > pBigArray.exe from explorer.
>
> Unfortunately, this doesn't help either.
>
> Many thanks for looking into it,
> Helmut.
>
> --
> Helmut Jarausch
>
> Lehrstuhl fuer Numerische Mathematik
> Institute of Technology, RWTH Aachen
> D 52056 Aachen, Germany
>
|
|
From: Hongli L. <h....@ch...> - 2002-05-10 00:25:57
|
On Fri, 2002-05-10 at 01:30, Alfredo Cole wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi: > > I have a project that I have been developing using Dev-C++ 4 and > wxWindows 2.2.9. I have tried to compile the same project using > version 5 Beta 2, adding the lines in Project Options that were not > picked up by the new version, and I get "windres.exe can not find > wx/msw/hand.cur". The file is where it's supposed to be, and > reinstalling version 4 compiles the project again without any > problems. What could be causing this problem? > > Thank you. > I don't know about version 4, but WxWindows works correctly with the latest development version of Dev-C++. I will release a WxWindows package when Dev-C++ beta 3 is released. |
|
From: Alfredo C. <al...@ac...> - 2002-05-09 23:35:38
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi: I have a project that I have been developing using Dev-C++ 4 and wxWindows 2.2.9. I have tried to compile the same project using version 5 Beta 2, adding the lines in Project Options that were not picked up by the new version, and I get "windres.exe can not find wx/msw/hand.cur". The file is where it's supposed to be, and reinstalling version 4 compiles the project again without any problems. What could be causing this problem? Thank you. - -- Alfredo J. Cole http://www.acyc.com (Accounting Systems) http://www.clshonduras.com (Linux Hardware) PGP Key available from certserver.pgp.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.5 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE82waXu5DxuPWE298RAtyhAJ9Z30oIyo1imS/isUSX1jG07GnmfQCfZNAO JFGtlsBNaE0+ZocQFKXtSto= =MwYq -----END PGP SIGNATURE----- |
|
From: Hongli L. <h....@ch...> - 2002-05-09 00:18:27
|
Mateusz Podbielski wrote: >Hi. > > I'm about finish my project but when I try to include > "libmysqlclient" library using > 'gcc file.cpp -o file.exe -l libmysqlclient -l zlib' command compiler > throws 'no file or directory' even when I copy that library to the > same directory I've gcc in. I also have copies of libmysqlclient > library in all necessary directories. Where's the problem? > > > > It's -lz, not -l zlib |
|
From: Mateusz P. <mpo...@us...> - 2002-05-08 22:47:54
|
Hi. I'm about finish my project but when I try to include "libmysqlclient" library using 'gcc file.cpp -o file.exe -l libmysqlclient -l zlib' command compiler throws 'no file or directory' even when I copy that library to the same directory I've gcc in. I also have copies of libmysqlclient library in all necessary directories. Where's the problem? Thanks, -- Matt -- ===================================================================== character is what you are in the dark ===================================================================== |
|
From: jansb000 <jan...@pl...> - 2002-05-08 21:29:04
|
Tip: V a GUI-library from www.objectcentral.com ----- Original Message ----- From: "Hongli Lai" <h....@ch...> To: "Dev-C++" <dev...@li...> Sent: Saturday, May 04, 2002 12:43 PM Subject: Re: [Dev-C++] List of Freeware or Open Source C++ Class Libraries that Work with Dev-C++ > Yeoh HS wrote: > > >Hi everyone, > > > >First, my apologies for off-topic posts on Dev-C++ vs MSVC++. > > > >To get back on track, I have an idea to compile a listing of freeware or > >Open Source C++ class libraries or tools that work with Dev-C++. > > > >What we need is help from Dev-C++ users who are aware of such libs or tools > >to post URLs for such resources. This way, I believe more beginners will > >want to start or continue to use Dev-C++. > > > >I believe the Dev-C++ website has a packages section so I think we can help > >to update it. What say you, Dev-C++ webmaster? > > > > > > > Sure, I'd be glad to accept help. But I have no "packaging guide" or > anything like that. > > > > >As a start, this is an update on SQLite, a free embedded database in C and > >callable from C++. > ><extract from poster: D. Richard Hipp > > >SQLite version 2.4.10 is now available on the website: > >http://www.hwaci.com/sw/sqlite/ > ><end extract> > > > > > > > > OK, I'll take a look at it another time. > I'm having a feaver right now. :-( > > > > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: ban...@so... > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Jean-Michel P. <jm....@fr...> - 2002-05-08 14:32:48
|
Le Mercredi 8 Mai 2002 15:26, Hongli Lai a =E9crit : > Why don't you just use the binaries? Win32 binaries run on every Window= s > system, > so there's not much point in compiling them yourself. I wouldn't like to use the Cygwin installer because it might conflict wit= h=20 W32/Debian packages. Let me explain again what I would like to contribute= : 1) Package management - Port Debian dpkg to native Windows and compile it using mingw. This tas= k has=20 nearly been accomplished on http://debian-cygwin.sourceforge.net/bootstra= p/. dpkg is a very powerfull package system comparable to RPM on Linux. I don= 't=20 know if it is possible to compile dpkg natively under Windows using mingw= =2E - Create W32/Debian packages providing mingw core packages. - Compile Cygwin.dll using mingw. This will enable the creation of a firs= t=20 W32/Debian Cygwin.dll package. This should be possible using MSYS-1.0.7 a= nd=20 MinGW-1.1. This will allow to create W32/Debian packages and tell wether they depend= on=20 Cygwin or not. For example, we may offer Perl with depency to Cygwin and=20 another one with no depency (mingw). - Create W32/Debian packages providing Cygwin core packages. - Create a bunch of packages (Xfree / qt2 / KDE2 / Gnome). Porting has al= ready=20 been accomplised on Cygwin. Even KDE3 is on the way. - Create packages for Windows only software like Dev-C++. Nearly all GNU=20 Windows native programs should be included. 2) GUI installer W32/Debian installation should be performed within a single GUI. The=20 installation program will give access to all W32/Debian packages at once.= =20 Packages will be available on Debian mirrors. As Cygwin and mingw can co-exist, I think this project could well be achi= eved.=20 Any candidate? Help welcome. Cheers, Jean-Michel POURE |
|
From: Hongli L. <h....@ch...> - 2002-05-08 13:23:57
|
Jean-Michel POURE wrote: >Dear all, > >Did anyone succeed in compiling Cygwin.dll main dll using mingw and Dev-C++? I >am working on the W32-Debian project and would like to include Cygwin into >the distribution. > >Cheers, >Jean-Michel POURE > > > Why don't you just use the binaries? Win32 binaries run on every Windows system, so there's not much point in compiling them yourself. |
|
From: staale <st...@le...> - 2002-05-08 13:18:03
|
I have tried my sample program on a w2k machine now and it work al the way up to 31 (thats wher you meet the long border is it not)? If you send me your compiled binary, I'll giv it a try. (hmm, could be during thge weekend as I'm sceduled for the next 48 houers.:o) Also if you search for the drwtsn32.log file. Giv it a new name, delete it or what ever. Run the test program again. And then include the drwtsn32.log file in your mail to me. I might be able to help a litle bit more. The drwtsn32.log is a simpel debug dump file (I think www.sysinternals.com has an articel on how to read it). A thought, how do you start the program? From the Dev-C IDE or in a console window? If you use start-run-command.exe I belive you will be runing a nativ DOS session. You should use start-run-cmd.exe (don't nead the exe part) to get flat memmory. The last is what you get if you double click the pBigArray.exe from explorer. On the side line (this is not a windows 2000 feature): I think XP has a 'feature' where it anticcipates which OS it should run the program under. In your case it seams like it is running like a nativ dos (win95) program. I have no experience with XP my self so don't take my word for it.:o) I know that it is posible to turn the 'feature' off for particular programs. I think you rightclick the program and then select configuration from the pop-up menu. I wold assume you will have to do the same with all the programs in the bin folder of Dev-C to. Best regards Staale ----- Original Message ----- From: <jar...@ig...> To: <st...@le...> Cc: <h....@ch...> Sent: Wednesday, May 08, 2002 9:38 AM Subject: Re: [Dev-C++] not enough memory - how to configure Win2000 > On 7 May, staale wrote: > > Try the code below. I have allocated 30MB successfully on NT4 with SP6. Are > > you running NT or a win9x OS? They allocate memmory diffrently. (I'm no > > expert in how, just know they do..:o)) > > > > If you are running NT4, w2k (or XP) you get the task manager with > > Ctrl+Shift+Esc. There you can see how much memmory the program does use > > (hmm, sort of...) > > > > This is with devcpp version 4.9.2.9 from Hongli Lai. > > Many thanks! > > I have run your program (included below for reference) on my > Win 2000 SP2 box with 4096 Mb real memory and 2048 Mb swap space > (dual PIII) > > Running your program with input '1' (i.e. 1 Mb) it works just fine. > Inputting '2' or even more it crashes immediately (it doesn't reach > the 'system("PAUSE");' line. > > Displaying the event log I get > Source: DrWatson Event: 4097 > > Since I am a novice (? ignorant) w.r.t. Windows (I just do it for > my students) I have no idea what I can change. > (There are no memory problems. The box runs fine with all of its memory > under Linux for 'real' work) > > Many thanks for your help, > Helmut. > > > -- > Helmut Jarausch > > Lehrstuhl fuer Numerische Mathematik > Institute of Technology, RWTH Aachen > D 52056 Aachen, Germany > > ----- > > program given by Staale > > #include <iostream> > #include <stdio.h> > #include <stdlib.h> > > int main(int argc, char *argv[]) > { > const long MEGA_BYTE = 1024*1024; > long nMBSize = 1; > while (nMBSize != 0 ){ > cout << "Give MB size: "; > cin >> nMBSize; > char narrBig[nMBSize * MEGA_BYTE]; > cout << "char size: " << sizeof(char) << " Bytes." << endl; > cout << "Array size: " << sizeof(narrBig)<< " Bytes." << endl; > file://See if initializing each element makes a difference > for (unsigned long i = 0; i<nMBSize*MEGA_BYTE;i++){ > narrBig[i] = 'A'; > }//i > cout << "Array size: " << sizeof(narrBig) << endl; > file://If you store objects in the array remember to use: > delete []narrBig; > }//while (nMB.. > file://To have a breake before window closes, use: > system("PAUSE"); > return 0; > } > > > |
|
From: Jean-Michel P. <jm....@fr...> - 2002-05-08 13:06:31
|
Dear all, Did anyone succeed in compiling Cygwin.dll main dll using mingw and Dev-C= ++? I=20 am working on the W32-Debian project and would like to include Cygwin int= o=20 the distribution. Cheers, Jean-Michel POURE |
|
From: Ricardo R. <ri...@po...> - 2002-05-08 09:56:40
|
Yes, I see. There is one possibility: using pointers, isn't it?. The solution seems similar to the case of self-referenced structures: when you build a linked list or a binary tree you need a solution like that. Ricardo. |
|
From: staale <st...@le...> - 2002-05-07 21:42:41
|
Search for 'how to handel Circular references' or somthing like that. I =
also belive this situation usualy is discussed in a decent 'Design =
patterns' book.
MVH
Staale
----- Original Message -----=20
From: Shaddow=20
To: dev...@li...=20
Sent: Tuesday, May 07, 2002 10:24 PM
Subject: Re: [Dev-C++] Foward declaration
I didn't see the original question so I may be answering something =
that hasn't actually been asked. If so, just ignore what I have to say.
While it's true that you'd get yourself into all kinds of trouble =
trying to have A be a data member of B and B a data member of A, it is =
entirely possible (and actually at times necessary) to have B* be a data =
member of A and A* be a data member of B. You see this kind of a =
situation frequently in frameworks.
class B;
class A
{
B* b;
};
class B
{
A* a;
};
Ioannis Vranos wrote:
I suppose the question was for me and i suppose the question is to have2 =
classes one containing an object of the other (i did not pay =
muchattention when i saw the code).Well this cannot be done and it is =
good it can't be done, because thenthe computers would crash. :)Imagine =
the code:class B;class A{ B b;};class B{ A a;};A contains a B which =
contains an A which contains a B...That's why it can't be done.Ioannis* =
Ioannis Vranos* Programming pages: http://www.noicys.cjb.net* =
Alternative URL: http://run.to/noicys
-----Original Message-----From: =
dev...@li... =
[mailto:dev...@li...] On Behalf Of Ricardo =
L=F3pez RuizSent: Tuesday, May 07, 2002 9:45 PMTo: Dev-C++Subject: Re: =
[Dev-C++] Foward declarationThen, is there no possibility to program =
somethingas Luis Bras propose??...Some special trick, I =
mean.Ricardo.____________________________________________________________=
___Have big pipes? SourceForge.net is looking for download mirrors. We =
supplythe hardware. You get the recognition. Email Us: =
bandwidth@sourceforge.net_______________________________________________D=
ev-
cpp-users mailing =
lis...@li...://lists.sourceforge.net/list=
s/listinfo/dev-cpp-users
_______________________________________________________________Have big =
pipes? SourceForge.net is looking for download mirrors. We supplythe =
hardware. You get the recognition. Email Us: =
bandwidth@sourceforge.net_______________________________________________D=
ev-cpp-users mailing =
lis...@li...://lists.sourceforge.net/list=
s/listinfo/dev-cpp-users
|
|
From: Ioannis V. <no...@ho...> - 2002-05-07 20:54:40
|
Yes, that's rational. I explained why 2 classes can't have objects of
one another both at the same time (1 object occupies at least one byte
even if it belongs to an empty class:
=20
class emtpy{};
=20
).
=20
So it was a situation with an infinite number of objects (and memory)
so it correctly doesn't compile. The situation you describe is ok.
=20
=20
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
<http://www.noicys.cjb.net/>=20
* Alternative URL: http://run.to/noicys
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Shaddow
Sent: Tuesday, May 07, 2002 11:24 PM
To: dev...@li...
Subject: Re: [Dev-C++] Foward declaration
I didn't see the original question so I may be answering something that
hasn't actually been asked. If so, just ignore what I have to say.
While it's true that you'd get yourself into all kinds of trouble trying
to have A be a data member of B and B a data member of A, it is entirely
possible (and actually at times necessary) to have B* be a data member
of A and A* be a data member of B. You see this kind of a situation
frequently in frameworks.
class B;
class A
{
B* b;
};
class B
{
A* a;
};
Ioannis Vranos wrote:
I suppose the question was for me and i suppose the question is to have
2 classes one containing an object of the other (i did not pay much
attention when i saw the code).
Well this cannot be done and it is good it can't be done, because then
the computers would crash. :)
Imagine the code:
class B;
class A
{
B b;
};
class B
{
A a;
};
A contains a B which contains an A which contains a B...
That's why it can't be done.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
-----Original Message-----
From: dev...@li...=20
[mailto:dev...@li...] On Behalf=20
Of Ricardo L=F3pez Ruiz
Sent: Tuesday, May 07, 2002 9:45 PM
To: Dev-C++
Subject: Re: [Dev-C++] Foward declaration
Then, is there no possibility to program something
as Luis Bras propose??...Some special trick, I mean.
Ricardo.
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download=20
mirrors. We supply
the hardware. You get the recognition. Email Us:=20
ban...@so...
_______________________________________________
Dev-
cpp-users mailing list
Dev...@li...
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We
supply
the hardware. You get the recognition. Email Us:
ban...@so...
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Shaddow <sh...@ti...> - 2002-05-07 20:24:04
|
I didn't see the original question so I may be answering something that
hasn't actually been asked. If so, just ignore what I have to say.
While it's true that you'd get yourself into all kinds of trouble trying
to have A be a data member of B and B a data member of A, it is entirely
possible (and actually at times necessary) to have B* be a data member
of A and A* be a data member of B. You see this kind of a situation
frequently in frameworks.
class B;
class A
{
B* b;
};
class B
{
A* a;
};
Ioannis Vranos wrote:
>I suppose the question was for me and i suppose the question is to have
>2 classes one containing an object of the other (i did not pay much
>attention when i saw the code).
>
>
>Well this cannot be done and it is good it can't be done, because then
>the computers would crash. :)
>
>
>Imagine the code:
>
>class B;
>
>class A
>{
> B b;
>
>};
>
>class B
>{
> A a;
>};
>
>
>A contains a B which contains an A which contains a B...
>
>
>That's why it can't be done.
>
>Ioannis
>
>* Ioannis Vranos
>* Programming pages: http://www.noicys.cjb.net
>* Alternative URL: http://run.to/noicys
>
>
>>-----Original Message-----
>>From: dev...@li...
>>[mailto:dev...@li...] On Behalf
>>Of Ricardo Lσpez Ruiz
>>Sent: Tuesday, May 07, 2002 9:45 PM
>>To: Dev-C++
>>Subject: Re: [Dev-C++] Foward declaration
>>
>>
>>Then, is there no possibility to program something
>>as Luis Bras propose??...Some special trick, I mean.
>>
>>Ricardo.
>>
>>
>>_______________________________________________________________
>>
>>Have big pipes? SourceForge.net is looking for download
>>mirrors. We supply
>>the hardware. You get the recognition. Email Us:
>>ban...@so...
>>_______________________________________________
>>Dev-cpp-users mailing list
>>Dev...@li...
>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>>
>
>_______________________________________________________________
>
>Have big pipes? SourceForge.net is looking for download mirrors. We supply
>the hardware. You get the recognition. Email Us: ban...@so...
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Ioannis V. <no...@ho...> - 2002-05-07 19:22:54
|
I suppose the question was for me and i suppose the question is to have
2 classes one containing an object of the other (i did not pay much
attention when i saw the code).
Well this cannot be done and it is good it can't be done, because then
the computers would crash. :)
Imagine the code:
class B;
class A
{
B b;
};
class B
{
A a;
};
A contains a B which contains an A which contains a B...
That's why it can't be done.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of Ricardo L=F3pez Ruiz
> Sent: Tuesday, May 07, 2002 9:45 PM
> To: Dev-C++
> Subject: Re: [Dev-C++] Foward declaration
>=20
>=20
> Then, is there no possibility to program something
> as Luis Bras propose??...Some special trick, I mean.
>=20
> Ricardo.
>=20
>=20
> _______________________________________________________________
>=20
> Have big pipes? SourceForge.net is looking for download=20
> mirrors. We supply
> the hardware. You get the recognition. Email Us:=20
> ban...@so...
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
|
|
From: Ricardo R. <ri...@po...> - 2002-05-07 18:47:43
|
Then, is there no possibility to program something as Luis Bras propose??...Some special trick, I mean. Ricardo. |
|
From: staale <st...@le...> - 2002-05-07 18:34:08
|
Try the code below. I have allocated 30MB successfully on NT4 with SP6. Are
you running NT or a win9x OS? They allocate memmory diffrently. (I'm no
expert in how, just know they do..:o))
If you are running NT4, w2k (or XP) you get the task manager with
Ctrl+Shift+Esc. There you can see how much memmory the program does use
(hmm, sort of...)
Why does Outlook insert file: infront of all //. Sorry but you have to
remove that by hand (Courtesy to M$)..
I think you shuld do some debugging. Install the Insight5_win32 debugger and
you should be well off.
------------ code snip -----------
#include <iostream>
file://#include <stdio.h>
file://#include <stdlib.h> file://usedt by system("PAUSE")
int main(int argc, char *argv[])
{
const long MEGA_BYTE = 1024*1024;
long nMBSize = 1;
while (nMBSize != 0 ){
cout << "Give MB size: ";
cin >> nMBSize;
char narrBig[nMBSize * MEGA_BYTE];
cout << "char size: " << sizeof(char) << " Bytes." << endl;
cout << "Array size: " << sizeof(narrBig)<< " Bytes." << endl;
file://See if initializing each element makes a difference
for (unsigned long i = 0; i<nMBSize*MEGA_BYTE;i++){
narrBig[i] = 'A';
}//i
cout << "Array size: " << sizeof(narrBig) << endl;
file://If you store objects in the array remember to use:
delete []narrBig;
}//while (nMB..
file://To have a breake before window closes, use:
file://system("PAUSE");
return 0;
}
------------ code snip end -------
Best regards
Staale Flock
----- Original Message -----
From: <jar...@ig...>
To: <dev...@li...>
Sent: Tuesday, May 07, 2002 1:26 PM
Subject: [Dev-C++] not enough memory - how to configure Win2000
> Hi all,
>
> I probably have a very common and simple question,
> but WinXXX is not my primary OS.
>
> When I start an application with Dev-C++ (4.9.2.9)
> I have not enough memory under Win2000
> How can I configure Win2000 to give DOS more
> extended memory (there are 4 Gb memory available!)
>
> Thanks for a hint,
>
> Helmut Jarausch
>
> Lehrstuhl fuer Numerische Mathematik
> Institute of Technology, RWTH Aachen
> D 52056 Aachen, Germany
>
>
> _______________________________________________________________
>
> Have big pipes? SourceForge.net is looking for download mirrors. We supply
> the hardware. You get the recognition. Email Us: ban...@so...
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Ioannis V. <no...@ho...> - 2002-05-07 18:10:55
|
ANSI C++ forbids the definition of an object before its type is defined. It's not a compiler problem. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Lums Bras > Sent: Tuesday, May 07, 2002 7:51 PM > To: dev...@li... > Subject: [Dev-C++] Foward declaration > > > I've tried to compiled the following program > with dev-c but it seams that the Migw compiler > does not accept foward declarations. Can anyone > help me? > > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > class ClassB; > > class ClassA > { > public: > int m_ClassA; > ClassB m_ClassB; > ClassA(void) > { > m_ClassA = 1; > }; > void InitializeWith( int iClassA ) > { > m_ClassA = iClassA; > m_ClassB.InitializeWith( iClassA ); > }; > }; > > class ClassB > { > public: > int m_ClassB; > ClassA m_ClassA; > ClassB(void) > { > m_ClassB = 1; > }; > void InitializeWith( int iClassB ) > { > m_ClassB = iClassB; > m_ClassA.InitializeWith( iClassB ); > }; > }; > > int main(int argc, char *argv[]) > { > ClassA TClassA; > ClassB TClassB; > > TClassA.InitializeWith( 10 ); > TClassB.InitializeWith( 20 ); > > return 0; > } > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ > > __________________________________________________ > Do You Yahoo!? > Yahoo! Health - your guide to health and wellness > http://health.yahoo.com > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download > mirrors. We supply > the hardware. You get the recognition. Email Us: > ban...@so... > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |