dev-cpp-users Mailing List for Dev-C++ (Page 3)
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
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(7) |
2
(2) |
3
(9) |
4
(10) |
5
(6) |
|
6
(1) |
7
(2) |
8
(6) |
9
(13) |
10
(5) |
11
(11) |
12
(15) |
|
13
(3) |
14
(7) |
15
(17) |
16
(12) |
17
(4) |
18
(9) |
19
(10) |
|
20
(10) |
21
(8) |
22
(12) |
23
(14) |
24
(6) |
25
(4) |
26
(8) |
|
27
(8) |
28
(9) |
29
(5) |
30
(11) |
31
(1) |
|
|
|
From: A. E. H. <ze...@ze...> - 2002-01-24 03:10:36
|
Your mail received. Thank You, A. Erdogan Horzum www.zetamuhendislik.com |
|
From: <tho...@ya...> - 2002-01-24 02:59:52
|
hi Jay, hey Ioannis,
i executed the hanoi code in the ioannis ANSI version
and it runs on windowNT perfectly.
but i compiled it with borland.
thomas
--- Ioannis Vranos <no...@ya...> ha scritto: >
That was cool but you had ommitted stdio.h for
> getchar().
>
> I converted your code to be valid ANSI C++ (you had
> coded in preANSI
> style):
>
>
> /* Jay Silverman //
> // Lab 19.6 The Towers of Hanoi //
> // 12-4-01 */
>
>
> #include <iostream>
> #include <fstream>
> #include <cstdio>
>
> void solveHanoi(const int disks,const int from,const
> int to,const int
> use,
> int &moves, std::ofstream &fout, const int
> choice);
>
> int main(){
>
> using namespace std;
>
> // Var. declar.
>
> int disks=0,moves=0,choice=0;
>
> ofstream fout("TowersofHanoi.out");
>
> // Intro text
>
> cout<<"Welcome to Joy's Towers of Hanoi
> Solver App!\n";
>
>
cout<<"--------------------------------------------\n\n";
> fout<<"Welcome to Joy's Towers of Hanoi
> Solver App!\n";
>
>
fout<<"--------------------------------------------\n\n";
>
> cout<<" The formula for the minimum number
> of moves is\n";
> cout<<" simple. It is # of moves =
> (2^disks)-1.\n\n";
> fout<<" The formula for the minimum number
> of moves is\n";
> fout<<" simple. It is # of moves =
> (2^disks)-1.\n\n";
>
> cout<<" How was this derived? Well, one must
> first know\n";
> cout<<" the three things needed done to
> solve this
> puzzle.\n\n";
> fout<<" How was this derived? Well, one
> must first know\n";
> fout<<" the three things needed done to
> solve this
> puzzle.\n\n";
>
> cout<<" Once one knows that, you can use it
> to create a
> very\n";
> cout<<" simple yet not necessarily easily
> thought of
> recursive\n";
> cout<<" function, and using that, some
> thought, and perhaps
> some\n";
> cout<<" playing around, derive the
> formula.\n\n";
> fout<<" Once one knows that, you can use it
> to create a
> very\n";
> fout<<" simple yet not necessarily easily
> thought of
> recursive\n";
> fout<<" function, and using that, some
> thought, and perhaps
> some\n";
> fout<<" playing around, derive the
> formula.\n\n";
>
> getchar();
>
> cout<<" Mathematical induction is mean.
> :)\n\n";
> fout<<" Mathematical induction is mean.
> :)\n\n";
>
> getchar();
>
> cout<<" How long will 64 disks take, at one
> move per two
> seconds?\n\n";
> cout<<" (2^disks)-1 is equal to
> 18,446,744,073,709,551,615
> moves.\n";
> cout<<" Multiply that by 2, and you will
> find out it will
> take\n";
> cout<<" 36,893,488,147,419,103,230 seconds
> to complete. Not
> bad! >.<\n\n";
> fout<<" How long will 64 disks take, at one
> move per two
> seconds?\n\n";
> fout<<" (2^disks)-1 is equal to
> 18,446,744,073,709,551,615
> moves.\n";
> fout<<" Multiply that by 2, and you will find out
> it will take\n";
> fout<<" 36,893,488,147,419,103,230 seconds
> to complete. Not
> bad! >.<\n\n";
>
> getchar();
>
> // Get number of disks, must be 1 or
> higher...
>
> while(disks<1){
>
> cout<<"Number of disks? ";
> fout<<"Number of disks? ";
>
> cin>>disks;
> fout<<disks<<endl;
>
> }
>
> // Does the user want to pause after each
> move?
>
> while(choice!=1 && choice!=2){
>
> cout<<"\nPause after each move? (1) Yes,
> (2) No? ";
> fout<<"\nPause after each move? (1)
> Yes, (2) No? ";
>
> cin>>choice;
> fout<<choice<<endl;
>
> }
>
> // Solve it! :)
>
> solveHanoi(disks,1,2,3,moves,fout,choice);
>
> // How many moves did it take?
>
> cout<<"\n\n** Only "<<moves<<" move(s)!
> Fun. :) **";
> fout<<"\n\n** Only "<<moves<<" move(s)!
> Fun. :) **";
>
> getchar();
>
> fout.close();
>
> }
>
> // Function which solves the puzzle. Required a
> better
> // understading of the puzzle than I had in fourth
> // grade ( :) ) and a bit of playing around to get
> to work.
>
> void solveHanoi(const int disks,const int from,const
> int to,const int
> use,
> int &moves, std::ofstream &fout,const int choice)
> {
> using namespace std;
>
> // No disks? No function.
>
> if (disks==0) return;
>
> // The main recursive loop code, does
> // everything while outputting the moves
> // and couting the number of moves...
>
>
> solveHanoi(disks-1,from,use,to,moves,fout,choice);
>
> cout<<"\n Move disk from peg "<<from<<" to
> peg "<<to<<".";
> fout<<"\n Move disk from peg "<<from<<" to
> peg "<<to<<".\n";
>
> if (choice==1) getchar();
> else cout<<endl;
>
> moves++;
>
>
=== message truncated ===
______________________________________________________________________
Dillo con una cartolina!
http://it.greetings.yahoo.com/
|
|
From: <the...@ju...> - 2002-01-23 22:33:38
|
int main(int argv, char *argv[]) {...} is the 'correct' way.
|
|
From: <the...@ju...> - 2002-01-23 22:33:35
|
int main(int argv, char *argv[]) {...} is the 'correct' way.
|
|
From: Ioannis V. <no...@ya...> - 2002-01-23 19:38:55
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Luigi Santillo
> Sent: Wednesday, January 23, 2002 6:09 PM
> To: dev...@li...
> Subject: RE: Fw: [Dev-C++] First experience with Dev-C++
>
> >...
> >
> > > #include <stdio.h>
> > > int main(int argc, char *argv[])
> > > {
> > > printf("Hello Dev-C++");
> > > return 0;
> > > }
> >
> >...
> >
> > > #include <iostream>
> > > #include <stdlib.h>
> > > int main(char * argv = new char [1024], int argc)
> > > {
> > > cout << "Hello Dev-C++";
> > >
> > > delete [] argv;
> > >
> > > float wait = 0;
> > > while (wait < 1E9) //see program notes
> > > wait++;
> > >
> > > return 0;
> > > }
> >
> >...
> >
> > > - is the order of the parameters correct in the first or in the
> > > second
> > version?
> >
> >The order of parameters doesn't matter.
>
> Probably my last question was not very clear. Here it is again.
>
> Which one of these is correct?
>
> int main(int argc, char **argv) {...} | int main(char
> **argv, int
> argc) {...}
>
> Or are the two forms both correct?
> In other words: the order of parameters does or does not matter)?
Oh that. Yes the order *does* matter.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
|
|
From: Luigi S. <gi...@li...> - 2002-01-23 16:26:11
|
At 17:13 22/01/02 +0200, Ioannis Vranos wrote:
> >
> > Hello list,
> >
> > Consider me as a newbie, I just know (or think to know) a few
> > elementary things about C (I mean "antique" ANSI C-89).
>
>I wouldn't say it is an antique. :)
Thanks, I feel a bit younger know :-)
>...
>
> > #include <stdio.h>
> > int main(int argc, char *argv[])
> > {
> > printf("Hello Dev-C++");
> > return 0;
> > }
>
>...
>
> > #include <iostream>
> > #include <stdlib.h>
> > int main(char * argv = new char [1024], int argc)
> > {
> > cout << "Hello Dev-C++";
> >
> > delete [] argv;
> >
> > float wait = 0;
> > while (wait < 1E9) //see program notes
> > wait++;
> >
> > return 0;
> > }
>
>...
>
> > - is the order of the parameters correct in the first or in the second
> version?
>
>The order of parameters doesn't matter.
Probably my last question was not very clear. Here it is again.
Which one of these is correct?
int main(int argc, char **argv) {...} | int main(char **argv, int
argc) {...}
Or are the two forms both correct?
In other words: the order of parameters does or does not matter)?
--
Luigi
gi...@li...
|
|
From: Luigi S. <gi...@li...> - 2002-01-23 16:26:04
|
Some time ago I was asked to solve this: Towers of Hanoi: given a stack of disks, threaded onto one peg and arranged from bottom to top in decreasing size, move the stack to a second peg under the following two conditions: - one disk is moved at a time - at no time may a larger disk be placed above a smaller one A third peg is available for temporarily holding disks. If your problem is similar to the one above, one solution could be using "induction" as suggested by Mr. Silverman: if you have one disk, move it and you are over; when there is more than a disk, say n, move the n - 1 small ones on the temporary peg, then place the n-th (the biggest) on the destination peg, finally move the small ones from the temporary peg to the destination one. I've attached an archive with two directories, one has my very simple (original) C solution and the other has a C++ version of it. Let me know if you find them of some help. At 01:16 23/01/02 +0000, chromatonus 712 wrote: >Anyone has a simple source code for this (any number of disks)? Thank you! -- Luigi gi...@li... |
|
From: Daniel G. <sp...@ho...> - 2002-01-23 15:58:47
|
<html><div style='background-color:'><DIV>Have you tried asking on gamedev.net ?</DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_etl_EN.asp'>http://explorer.msn.com</a>.<br></html> |
|
From: Sonam C. <so...@ac...> - 2002-01-23 13:34:17
|
MessageIoannis - Thanks for the tip. I installed the latest mingw but it = still didn't work.=20 Basically cygwin and mingw both don't have the SetLayeredWindowAttribute = function in their include files. Maybe because they're strapped down = implementations. The Microsoft SDK does, and so does Borland's free bcc = 5.5 command line compiler.=20 I finally gave up on mingw and sat down to fix a previous problem with = my progam's compilation under the Borland compiler. It's working now - = and I have a nice translucent window app running on my desktop. :) To the Dev-C++ guys - is it possible at all to have the dev-c++ IDE use = Borland's Compiler too. I tried, but it seems to only call gcc.exe = instead of bcc32.exe=20 Sonam ----- Original Message -----=20 From: Ioannis Vranos=20 To: Dev-C++=20 Sent: Wednesday, January 23, 2002 1:01 PM Subject: RE: [Dev-C++] Win2000 specific function unavailable Dev-C++ is an graphical editor which uses a third party free compiler = the MINGW32. Download the latest MINGW32 compiler and install it in the = Dev-C++\bin directory so as to use the latest version. MINGW32 is GCC = port for Windows that's why it carries things for many languages. The = standard version carries, C/C++/Objective C/Fortran compilers. MINGW32: http://www.mingw.org/ Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... = [mailto:dev...@li...] On Behalf Of Sonam = Chauhan Sent: Wednesday, January 23, 2002 12:00 AM To: dev...@li... Subject: [Dev-C++] Win2000 specific function unavailable I've been trying to use a in Dev-C++ for Windows. However = Dev-C++ throws an error saying : implicit declaration of function `int = SetLayeredWindowAttributes(...)' I've grepped the Dev-C++ Include directories and the = SetLayeredWindowAttributes function is missing. Are there any plans to = update the Include directories? To fix this, I installed the Microsoft SDK (all 300 MB of it) and = pointed Dev-C++'s include and lib files to it. However it now throws a = new error: 166 c:\progra~1\micros~3\include\windef.h from = C:\PROGRA~1\MICROS~3\Include\windows.h:161, The specific line in windef.h says " #include <winnt.h> " :-( I don't know how to fix this! Someone help? Sonam |
|
From: Ben C. <cra...@ya...> - 2002-01-23 10:20:53
|
Hi List, I have posted this question before with no response, so I'm gonna give it another bash :) I would like to create a small DLL in C++ to be used within MapBasic. There is some complex math functions I would like to do and I would rather C++ does them than MapBasic. So I thought making a DLL that contains the math code and then pass the values from MapBasic to the DLL. I'm fairly new to this so any advice would be greatly appreciated... Thanx, Ben __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ |
|
From: Joshua T. <vap...@ms...> - 2002-01-23 06:08:21
|
Don't you have an any key?:) Joshua Thomas If not : http://www.computergear.com/bits---bytes.html =20 --------First choice------- printf( "Press [enter] to quit..." ); getchar();Get more from the Web. FREE MSN Explorer download : http://exp= lorer.msn.com |
|
From: A. E. H. <ze...@ze...> - 2002-01-23 02:18:37
|
Your mail received. Thank You, A. Erdogan Horzum www.zetamuhendislik.com |
|
From: Ioannis V. <no...@ya...> - 2002-01-23 02:07:54
|
That was cool but you had ommitted stdio.h for getchar().
I converted your code to be valid ANSI C++ (you had coded in preANSI
style):
/* Jay Silverman //
// Lab 19.6 The Towers of Hanoi //
// 12-4-01 */
#include <iostream>
#include <fstream>
#include <cstdio>
void solveHanoi(const int disks,const int from,const int to,const int
use,
int &moves, std::ofstream &fout, const int choice);
int main(){
using namespace std;
// Var. declar.
int disks=0,moves=0,choice=0;
ofstream fout("TowersofHanoi.out");
// Intro text
cout<<"Welcome to Joy's Towers of Hanoi Solver App!\n";
cout<<"--------------------------------------------\n\n";
fout<<"Welcome to Joy's Towers of Hanoi Solver App!\n";
fout<<"--------------------------------------------\n\n";
cout<<" The formula for the minimum number of moves is\n";
cout<<" simple. It is # of moves = (2^disks)-1.\n\n";
fout<<" The formula for the minimum number of moves is\n";
fout<<" simple. It is # of moves = (2^disks)-1.\n\n";
cout<<" How was this derived? Well, one must first know\n";
cout<<" the three things needed done to solve this
puzzle.\n\n";
fout<<" How was this derived? Well, one must first know\n";
fout<<" the three things needed done to solve this
puzzle.\n\n";
cout<<" Once one knows that, you can use it to create a
very\n";
cout<<" simple yet not necessarily easily thought of
recursive\n";
cout<<" function, and using that, some thought, and perhaps
some\n";
cout<<" playing around, derive the formula.\n\n";
fout<<" Once one knows that, you can use it to create a
very\n";
fout<<" simple yet not necessarily easily thought of
recursive\n";
fout<<" function, and using that, some thought, and perhaps
some\n";
fout<<" playing around, derive the formula.\n\n";
getchar();
cout<<" Mathematical induction is mean. :)\n\n";
fout<<" Mathematical induction is mean. :)\n\n";
getchar();
cout<<" How long will 64 disks take, at one move per two
seconds?\n\n";
cout<<" (2^disks)-1 is equal to 18,446,744,073,709,551,615
moves.\n";
cout<<" Multiply that by 2, and you will find out it will
take\n";
cout<<" 36,893,488,147,419,103,230 seconds to complete. Not
bad! >.<\n\n";
fout<<" How long will 64 disks take, at one move per two
seconds?\n\n";
fout<<" (2^disks)-1 is equal to 18,446,744,073,709,551,615
moves.\n";
fout<<" Multiply that by 2, and you will find out it will take\n";
fout<<" 36,893,488,147,419,103,230 seconds to complete. Not
bad! >.<\n\n";
getchar();
// Get number of disks, must be 1 or higher...
while(disks<1){
cout<<"Number of disks? ";
fout<<"Number of disks? ";
cin>>disks;
fout<<disks<<endl;
}
// Does the user want to pause after each move?
while(choice!=1 && choice!=2){
cout<<"\nPause after each move? (1) Yes, (2) No? ";
fout<<"\nPause after each move? (1) Yes, (2) No? ";
cin>>choice;
fout<<choice<<endl;
}
// Solve it! :)
solveHanoi(disks,1,2,3,moves,fout,choice);
// How many moves did it take?
cout<<"\n\n** Only "<<moves<<" move(s)! Fun. :) **";
fout<<"\n\n** Only "<<moves<<" move(s)! Fun. :) **";
getchar();
fout.close();
}
// Function which solves the puzzle. Required a better
// understading of the puzzle than I had in fourth
// grade ( :) ) and a bit of playing around to get to work.
void solveHanoi(const int disks,const int from,const int to,const int
use,
int &moves, std::ofstream &fout,const int choice)
{
using namespace std;
// No disks? No function.
if (disks==0) return;
// The main recursive loop code, does
// everything while outputting the moves
// and couting the number of moves...
solveHanoi(disks-1,from,use,to,moves,fout,choice);
cout<<"\n Move disk from peg "<<from<<" to peg "<<to<<".";
fout<<"\n Move disk from peg "<<from<<" to peg "<<to<<".\n";
if (choice==1) getchar();
else cout<<endl;
moves++;
solveHanoi(disks-1,use,to,from,moves,fout,choice);
}
I just made the conversion haven't checked how the code works.
Ioannis
* Ioannis Vranos
* Programming pages: <http://www.noicys.d2g.com/>
http://www.noicys.d2g.com
* Alternative URL: <http://run.to/noicys> http://run.to/noicys
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Jason
Silverman
Sent: Wednesday, January 23, 2002 3:20 AM
To: dev...@li...
Subject: Re: [Dev-C++] Tower of Hanoi
Let's try this again. This time I'll actually send the email to the
group. *sigh* =)
|
|
From: Ioannis V. <no...@ya...> - 2002-01-23 02:00:22
|
Dev-C++ is an graphical editor which uses a third party free compiler the MINGW32. Download the latest MINGW32 compiler and install it in the Dev-C++\bin directory so as to use the latest version. MINGW32 is GCC port for Windows that's why it carries things for many languages. The standard version carries, C/C++/Objective C/Fortran compilers. MINGW32: http://www.mingw.org/ Ioannis * Ioannis Vranos * Programming pages: <http://www.noicys.d2g.com/> http://www.noicys.d2g.com * Alternative URL: <http://run.to/noicys> http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Sonam Chauhan Sent: Wednesday, January 23, 2002 12:00 AM To: dev...@li... Subject: [Dev-C++] Win2000 specific function unavailable I've been trying to use a in Dev-C++ for Windows. However Dev-C++ throws an error saying : implicit declaration of function `int SetLayeredWindowAttributes(...)' I've grepped the Dev-C++ Include directories and the SetLayeredWindowAttributes function is missing. Are there any plans to update the Include directories? To fix this, I installed the Microsoft SDK (all 300 MB of it) and pointed Dev-C++'s include and lib files to it. However it now throws a new error: 166 c:\progra~1\micros~3\include\windef.h from C:\PROGRA~1\MICROS~3\Include\windows.h:161, The specific line in windef.h says " #include <winnt.h> " :-( I don't know how to fix this! Someone help? Sonam |
|
From: Jason S. <mys...@op...> - 2002-01-23 01:20:34
|
Let's try this again. This time I'll actually send the email to the group. *sigh* =)
-------
Just did this for an extra credit project, actually. :)
I'll include the full source code here....don't just copy, please. It actually did take some work to do. :)
Jason
-------
/* Jay Silverman //
// Lab 19.6 The Towers of Hanoi //
// 12-4-01 */
#include <iostream.h>
#include <fstream.h>
void solveHanoi(const int disks,const int from,const int to,const int use,
int &moves,ofstream &fout, const int choice);
void main(){
// Var. declar.
int disks=0,moves=0,choice=0;
ofstream fout("TowersofHanoi.out");
// Intro text
cout<<"Welcome to Joy's Towers of Hanoi Solver App!\n";
cout<<"--------------------------------------------\n\n";
fout<<"Welcome to Joy's Towers of Hanoi Solver App!\n";
fout<<"--------------------------------------------\n\n";
cout<<" The formula for the minimum number of moves is\n";
cout<<" simple. It is # of moves = (2^disks)-1.\n\n";
fout<<" The formula for the minimum number of moves is\n";
fout<<" simple. It is # of moves = (2^disks)-1.\n\n";
cout<<" How was this derived? Well, one must first know\n";
cout<<" the three things needed done to solve this puzzle.\n\n";
fout<<" How was this derived? Well, one must first know\n";
fout<<" the three things needed done to solve this puzzle.\n\n";
cout<<" Once one knows that, you can use it to create a very\n";
cout<<" simple yet not necessarily easily thought of recursive\n";
cout<<" function, and using that, some thought, and perhaps some\n";
cout<<" playing around, derive the formula.\n\n";
fout<<" Once one knows that, you can use it to create a very\n";
fout<<" simple yet not necessarily easily thought of recursive\n";
fout<<" function, and using that, some thought, and perhaps some\n";
fout<<" playing around, derive the formula.\n\n";
getchar();
cout<<" Mathematical induction is mean. :)\n\n";
fout<<" Mathematical induction is mean. :)\n\n";
getchar();
cout<<" How long will 64 disks take, at one move per two seconds?\n\n";
cout<<" (2^disks)-1 is equal to 18,446,744,073,709,551,615 moves.\n";
cout<<" Multiply that by 2, and you will find out it will take\n";
cout<<" 36,893,488,147,419,103,230 seconds to complete. Not bad! >.<\n\n";
fout<<" How long will 64 disks take, at one move per two seconds?\n\n";
fout<<" (2^disks)-1 is equal to 18,446,744,073,709,551,615 moves.\n";
fout<<" Multiply that by 2, and you will find out it will take\n";
fout<<" 36,893,488,147,419,103,230 seconds to complete. Not bad! >.<\n\n";
getchar();
// Get number of disks, must be 1 or higher...
while(disks<1){
cout<<"Number of disks? ";
fout<<"Number of disks? ";
cin>>disks;
fout<<disks<<endl;
}
// Does the user want to pause after each move?
while(choice!=1 && choice!=2){
cout<<"\nPause after each move? (1) Yes, (2) No? ";
fout<<"\nPause after each move? (1) Yes, (2) No? ";
cin>>choice;
fout<<choice<<endl;
}
// Solve it! :)
solveHanoi(disks,1,2,3,moves,fout,choice);
// How many moves did it take?
cout<<"\n\n** Only "<<moves<<" move(s)! Fun. :) **";
fout<<"\n\n** Only "<<moves<<" move(s)! Fun. :) **";
getchar();
fout.close();
}
// Function which solves the puzzle. Required a better
// understading of the puzzle than I had in fourth
// grade ( :) ) and a bit of playing around to get to work.
void solveHanoi(const int disks,const int from,const int to,const int use,
int &moves,ofstream &fout,const int choice)
{
// No disks? No function.
if (disks==0) return;
// The main recursive loop code, does
// everything while outputting the moves
// and couting the number of moves...
solveHanoi(disks-1,from,use,to,moves,fout,choice);
cout<<"\n Move disk from peg "<<from<<" to peg "<<to<<".";
fout<<"\n Move disk from peg "<<from<<" to peg "<<to<<".\n";
if (choice==1) getchar();
else cout<<endl;
moves++;
solveHanoi(disks-1,use,to,from,moves,fout,choice);
}
----- Original Message -----
From: chromatonus 712
To: dev...@li...
Sent: Tuesday, January 22, 2002 8:16 PM
Subject: [Dev-C++] Tower of Hanoi
Anyone has a simple source code for this (any number of disks)? Thank you!
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: chromatonus 7. <chr...@ho...> - 2002-01-23 01:16:23
|
Anyone has a simple source code for this (any number of disks)? Thank you! _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com |
|
From: <mik...@em...> - 2002-01-22 23:02:03
|
This is simple. You can add one of two things at the end of the source file, right before the return 0; --------First choice------- printf( "Press [enter] to quit..." ); getchar(); --------Second Choice------- system( "pause" ); ------------------------------ I prefer the first choice as I use Linux also, and in Linux no pause command exists. For DOS only apps though, the second choice works fine. __________ Mike Shoup [http://www.psxfanatics.com] ___________________________________________ At 20:06 20/01/02 -0500, Rob Orlando wrote: >I am just learning c++ and have a question. When I execute a file my >application only appears for a fraction of a second then disappears. How >do I get it to stay up so I can read it? >Jen |
|
From: Sonam C. <so...@ac...> - 2002-01-22 21:56:54
|
I've been trying to use a in Dev-C++ for Windows. However Dev-C++ =
throws an error saying :
implicit declaration of function `int =
SetLayeredWindowAttributes(...)'
I've grepped the Dev-C++ Include directories and the =
SetLayeredWindowAttributes function is missing. Are there any plans to =
update the Include directories?
To fix this, I installed the Microsoft SDK (all 300 MB of it) and =
pointed Dev-C++'s include and lib files to it. However it now throws a =
new error:
166 c:\progra~1\micros~3\include\windef.h from =
C:\PROGRA~1\MICROS~3\Include\windows.h:161,
The specific line in windef.h says " #include <winnt.h> "
:-( I don't know how to fix this! Someone help?
Sonam
|
|
From: Daniel G. <sp...@ho...> - 2002-01-22 21:03:01
|
<html><div style='background-color:'><DIV> <P>You might find that your binary file isn't being saved to the PC. So perhaps at the end of your program the binary file that was created is deleted from memory, and when you start up the program again nothing happens.</P> <P>I've not done much with binary files (though it was in my course).<BR><BR></P></DIV> <DIV></DIV> <DIV></DIV>>From: Julio Lajara <JU2...@YA...> <DIV></DIV>>To: dev...@li... <DIV></DIV>>Subject: [Dev-C++] Binary Files in C++ <DIV></DIV>>Date: Tue, 22 Jan 2002 12:50:21 -0800 (PST) <DIV></DIV>> <DIV></DIV>>I am having a problem after I write data to a binary <DIV></DIV>>file. I can read/write from the same binary file <DIV></DIV>>during one execution of my program, but when I go to <DIV></DIV>>read the data back in on a second execution of the <DIV></DIV>>program its like nothing was read... is the data in a <DIV></DIV>>binary file only good for one execution of a program? <DIV></DIV>> <DIV></DIV>>===== <DIV></DIV>>Julio <DIV></DIV>> <DIV></DIV>>__________________________________________________ <DIV></DIV>>Do You Yahoo!? <DIV></DIV>>Send FREE video emails in Yahoo! Mail! <DIV></DIV>>http://promo.yahoo.com/videomail/ <DIV></DIV>> <DIV></DIV>>_______________________________________________ <DIV></DIV>>Dev-cpp-users mailing list <DIV></DIV>>Dev...@li... <DIV></DIV>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV></div><br clear=all><hr>MSN Photos is the easiest way to share and print your photos: <a href='http://go.msn.com/bql/hmtag3_etl_EN.asp'>Click Here</a><br></html> |
|
From: Julio L. <ju2...@ya...> - 2002-01-22 20:50:24
|
I am having a problem after I write data to a binary file. I can read/write from the same binary file during one execution of my program, but when I go to read the data back in on a second execution of the program its like nothing was read... is the data in a binary file only good for one execution of a program? ===== Julio __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ |
|
From: <Ech...@ne...> - 2002-01-22 17:22:04
|
The printf() function is a C function, but not an antique. In fact, I find that many C++ projects use printf instead of cout (at least most of the one's that I am familiar with). Printf has more powerfull formatting features that cout . One disadvantage to printf is that it cannot print out classes which cout can do.
Evan
Message: 15
From: "Joshua Thomas" <vap...@ms...>
To: "Jilani Khaldi" <ji...@ti...>,
<Dev...@li...>
Subject: Re: [Dev-C++] First experience with Dev-C++
Date: Sun, 20 Jan 2002 15:02:39 -0500
------=_NextPart_001_0000_01C1A1C3.808E7940
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
printf() function is a C antique, so its considered bad style so I used c=
out which conforms to ANSI standard...See notes at bottem for further com=
ments. Let me know if you need more help. =20
Joshua Thomas
// Try the code this way: =20
=20
#include <iostream>
#include <stdlib.h>
int main(char * argv =3D new char [1024], int argc)
{
cout << "Hello Dev-C++"; //displays text in quotes... << directs t=
he string to cout
=20
delete [] argv; //deletes array and pointer, so there is no memor=
y leak
=20
float wait =3D 0;
while (wait < 1E9) //see program notes
wait++;
=20
return 0;
}
// Program notes: while loop makes the computer count to 1 billion before=
closing the console window. This may or may =20
// not be enough time depending on your computer. You can use the ctime l=
ibrary to make the program more portable.
// (setting the program keep time in seconds not computer processing tick=
s through use of the while loop) Also note that =20
// stdio.h is not a valid library I believe you were looking for stdlib. =
Also your pointer syntax was off I fixed it and set the =20
// pointer argv to point to an array with the size of 1 MB of chars. (102=
4 variables in array of type char formally)
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello Dev-C++");
return 0;
}
//
Well; from command line: g++ b.cpp it compiles and create a.exe
correctly. But from Dev-C++ I have just this list of errors:
c:\mingw\bin\ld.exe: warning: cannot find entry symbol _mainCRTStartup;
defaulting to 00401000
c:\a2\b.o(.text+0x17)://c/a2/b.cpp: undefined reference to `__main'
c:\a2\b.o(.text+0x24)://c/a2/b.cpp: undefined reference to `printf'
What am I missing?
- I have installed MingW at c:\mingw
- Dev-C++ is configuraed this way:
- bin directory: c:\mingw\bin\
- C include files c:\mingw\include\
- C++ include files c:\mingw\include\
- Libraries directory c:\mingw\lib\
- OS: W2k
Thanks a lot!
--
Jilani Khaldi
http://space.tin.it/scuola/jkhaldi
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
https://lists.sourceforge.net/lists/listinfo/dev-cpp-usersGet more from t=
he Web. FREE MSN Explorer download : http://explorer.msn.com
--
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
|
|
From: Ioannis V. <no...@ya...> - 2002-01-22 15:12:42
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Luigi Santillo
> Sent: Tuesday, January 22, 2002 3:49 PM
> To: dev...@li...
> Subject: Re: Fw: [Dev-C++] First experience with Dev-C++
>
>
> Hello list,
>
> Consider me as a newbie, I just know (or think to know) a few
> elementary
> things about C (I mean "antique" ANSI C-89).
I wouldn't say it is an antique. :)
> According to two recent posts, I received from this list, the
> following
> code (by Jilani Khaldi) does not work:
>
> #include <stdio.h>
> int main(int argc, char *argv[])
> {
> printf("Hello Dev-C++");
> return 0;
> }
This is C and it works, although the main arguments are not needed.
> While the following (by Joshua Thomas) is a working version of it:
>
> #include <iostream>
> #include <stdlib.h>
> int main(char * argv = new char [1024], int argc)
> {
> cout << "Hello Dev-C++";
>
> delete [] argv;
>
> float wait = 0;
> while (wait < 1E9) //see program notes
> wait++;
>
> return 0;
> }
This is C++ code but it is WRONG. Although it compiles strangely in
Dev-C++ it is WRONG. You can't delete argv since it is a static object
on the stack and not on the free store. Also it should be char *argv[]
or char **argv.
Also after the official C++ standard he should have used the using
namespace std; or using std::cout directives.
>
> Excluding the "float wait" stuff (not required if one runs
> applications
> from the command line), I'm a little confused:
> - is the second version written in "modern" ANSI C-98 (hope
> the year is
> right)?
The name is ANSI C99 and the answer is no. The code was a C++ attempt.
> - what need is there to include "stdlib.h"?
None. stdlib.h is not needed in that code.
> - is the order of the parameters correct in the first or in
> the second version?
The order of parameters doesn't matter.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
|
|
From: Luigi S. <gi...@li...> - 2002-01-22 14:08:06
|
Hi,
I tried to compile your code with my Dev-C++ 4.0 on Win98SE, and I had no
problem.
My Dev-C++ has been installed using the archive available from the Dev-C++
site (in other words I'm using the binary files that the author has prepared)
The project type that I used is "console application" and my configuration
is exactly the one that you use:
- bin directory: c:\mingw\bin\
- C include files c:\mingw\include\
- C++ include files c:\mingw\include\
- Libraries directory c:\mingw\lib\
By the way, I suggest you change the "C++ include files" so that it becomes:
"c:\mingw\include\g++;c:\mingw\include\", because some of the header files
for C++ are in the "\g++" subdirectory. This is not the problem in your
case, as your code uses only the C subset of C++.
At 12:27 20/01/02 +0100, Jilani Khaldi wrote:
>Hi All,
>I have downloaded MingW, installed it and it works fine from command
>line.
>I have already installed Dev-C++ (compiled from source) and it seems to
>work fine too.
>I have created a new project (myproject.dev) with this single unit:
>// b.cpp
>#include <stdio.h>
>
>int main(int argc, char *argv[])
>{
> printf("Hello Dev-C++");
> return 0;
>}
>//
>Well; from command line: g++ b.cpp it compiles and create a.exe
>correctly. But from Dev-C++ I have just this list of errors:
>
>c:\mingw\bin\ld.exe: warning: cannot find entry symbol _mainCRTStartup;
>defaulting to 00401000
>c:\a2\b.o(.text+0x17)://c/a2/b.cpp: undefined reference to `__main'
>c:\a2\b.o(.text+0x24)://c/a2/b.cpp: undefined reference to `printf'
>
>What am I missing?
>
>- I have installed MingW at c:\mingw
>- Dev-C++ is configuraed this way:
> - bin directory: c:\mingw\bin\
> - C include files c:\mingw\include\
> - C++ include files c:\mingw\include\
> - Libraries directory c:\mingw\lib\
>
>- OS: W2k
>
>Thanks a lot!
>
>--
>Jilani Khaldi
>http://space.tin.it/scuola/jkhaldi
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
--
Luigi
gi...@li...
|
|
From: Luigi S. <gi...@li...> - 2002-01-22 14:08:02
|
Hi, I like to add no special line of code, so here is what I do (say that the application one has to run is "c:\myprog\hello.exe"): - open a Dos box - type "c:" - type "cd\myprog" - type "hello" Of course you could instruct the "Dos prompt" to always switch to the directory "c:\myprog", so that the above becomes: - open a Dos box - type "hello" At 20:06 20/01/02 -0500, Rob Orlando wrote: >I am just learning c++ and have a question. When I execute a file my >application only appears for a fraction of a second then disappears. How >do I get it to stay up so I can read it? >Jen -- Luigi gi...@li... |
|
From: Luigi S. <gi...@li...> - 2002-01-22 14:08:01
|
Hello list,
Consider me as a newbie, I just know (or think to know) a few elementary
things about C (I mean "antique" ANSI C-89).
According to two recent posts, I received from this list, the following
code (by Jilani Khaldi) does not work:
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello Dev-C++");
return 0;
}
While the following (by Joshua Thomas) is a working version of it:
#include <iostream>
#include <stdlib.h>
int main(char * argv = new char [1024], int argc)
{
cout << "Hello Dev-C++";
delete [] argv;
float wait = 0;
while (wait < 1E9) //see program notes
wait++;
return 0;
}
Excluding the "float wait" stuff (not required if one runs applications
from the command line), I'm a little confused:
- is the second version written in "modern" ANSI C-98 (hope the year is
right)?
- what need is there to include "stdlib.h"?
- is the order of the parameters correct in the first or in the second version?
I would be glad to hear a word from someone.
TIA.
At 13:06 21/01/02 -0500, Joshua Thomas wrote:
>
> From: Joshua Thomas
> Sent: Monday, January 21, 2002 1:03 PM
> To: Kevin Wood
> Subject: Re: [Dev-C++] First experience with Dev-C++
>I agree with you on making arguments in main function for storage array a
>bad idea. I was presenting a working code that fixed what didn't work in
>his. If you compile the code he sent it doesn't compile without errors.
>Using printf() is still bad style. No reason to use it except because you
>can:) Cout does the job with less junkie looking code...
>Joshua Thomas
>
--
Luigi
gi...@li...
|