dev-cpp-users Mailing List for Dev-C++ (Page 615)
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: Mohammed R. <p_m...@ho...> - 2002-03-07 16:04:54
|
hey ioannis;
The variables i,j are members of the class. Why do you say recursion never
end. The function assignment calls the other functions 'refresh', 'value'
in the line
refresh();
pos=value(j+(8*i));
hence when the this situation (given below)arises in the function value, the
program wil hald and hence the recursion ends there.
if(row_loc<0) {cout<<"NO SOLUTION";system("pause");exit(0);}
(or)
when the situation
if(l==63)
{
cout<<"RESULT :"<<endl;
for(int k=0;k<64;k++)
cout<<denied[k]<<" ";
system("pause");
exit(0);
}
in refresh function is encountered the recursion ends.
-Riyaz
>From: "Ioannis Vranos" <no...@ya...>
>To: "Dev-C++" <dev...@li...>
>Subject: RE: [Dev-C++] reg-Knight's tour problem
>Date: Thu, 7 Mar 2002 15:20:47 +0200
>
> > -----Original Message-----
> > From: dev...@li...
> > [mailto:dev...@li...] On Behalf
> > Of Mohammed Riyaz
> > Sent: Thursday, March 07, 2002 2:00 PM
> > To: dev...@li...
> > Subject: [Dev-C++] reg-Knight's tour problem
> >
> >
> > hey,
> > I had a look at the code sent in. Am new to programming, my
> > code sux when
> > compared to that. :D .If any one of you cud fix this code
> > ,help me out. -Riyaz
> >
> > #include <iostream.h>
> > #include <stdlib.h>
>
>Useless
> > #include <process.h>
>
>Pre-ANSI header file declaration
>
>
> > class knight
> > {
> > int chess[8][8],location[65][10],denied[64];
> > int row_loc,pos,i,j;
> > public:
> > knight();
> > void assignment(void);
> > int value(int);
> > void refresh(void);
> > int append(int ,int);
> > };
> > knight::knight(void)
> > {
> > row_loc=-1;
> > i=j=0;
> > for(int m=0;m<8;m++)
> > for(int n=0;n<8;n++)
> > chess[m][n]=0;
> > for(int m=0;m<65;m++)
> > for(int n=0;n<10;n++)
> > location[m][n]=0;
> > for(int m=0;m<64;m++)
> > denied[m]=99;
> > assignment();
> > }
> > void knight::assignment(void)
> > {
> > chess[i][j]=1;
>
>
>Where are i, j defined? Strangely it compiles in MINGW32!!!! (compiler
>defect).
>
>
> > refresh();
> > pos=value(j+(8*i));
> > i=pos/8;
> > j=pos%8;
>
> > assignment();
>
>
>// Recursion never ends!
>
>
> > }
> > int knight::value(int val)
> > {
> > row_loc++;
> > int temp=1;
> > int lock,ii,jj;
> > location[row_loc][0]=val;
> > ii=val/8;
> > jj=val%8;
> > if(jj==0)
> > {
> > if(ii>=1)
> > {
> > if(ii>=2)
> > {lock=append(val-15,temp);if(lock==0) {temp++;}}
> > lock=append(val-6,temp);if(lock==0) {temp++;}
> > }
> > if(ii<=6)
> > {
> > if(ii<=5)
> > {lock=append(val+17,temp);if(lock==0) {temp++;}}
> > lock=append(val+10,temp);if(lock==0) {temp++;}
> > }
> > }
> > if(jj==7)
> > {
> > if(ii>=1)
> > {
> > if(ii>=2)
> > {lock=append(val-17,temp);if(lock==0) {temp++;}}
> > lock=append(val-10,temp);if(lock==0) {temp++;}
> > }
> > if(ii<=6)
> > {
> > if(ii<=5)
> > {lock=append(val+15,temp);if(lock==0) {temp++;}}
> > lock=append(val+6,temp);if(lock==0) {temp++;}
> > }
> > }
> > if(jj==1)
> > {
> > if(ii>=1)
> > {
> > if(ii>=2)
> > {
> > lock=append(val-15,temp);if(lock==0) {temp++;}
> > lock=append(val-17,temp);if(lock==0) {temp++;}
> > }
> > lock=append(val-6,temp);if(lock==0) {temp++;}
> > }
> > if(ii<=6)
> > {
> > if(ii<=5)
> > {
> > lock=append(val+17,temp);if(lock==0) {temp++;}
> > lock=append(val+15,temp);if(lock==0) {temp++;}
> > }
> > lock=append(val+10,temp);if(lock==0) {temp++;}
> > }
> > }
> > if(jj==6)
> > {
> > if(ii>=1)
> > {
> > if(ii>=2)
> > {
> > lock=append(val-15,temp);if(lock==0) {temp++;}
> > lock=append(val-17,temp);if(lock==0) {temp++;}
> > }
> > lock=append(val-10,temp);if(lock==0) {temp++;}
> > }
> > if(ii<=6)
> > {
> > if(ii<=5)
> > {
> > lock=append(val+17,temp);if(lock==0) {temp++;}
> > lock=append(val+15,temp);if(lock==0) {temp++;}
> > }
> > lock=append(val+6,temp);if(lock==0) {temp++;}
> > }
> > }
> > if(jj>1 && jj<6)
> > {
> > if(ii>=1)
> > {
> > if(ii>=2)
> > {
> > lock=append(val-17,temp);if(lock==0) {temp++;}
> > lock=append(val-15,temp);if(lock==0) {temp++;}
> > }
> > lock=append(val-10,temp);if(lock==0) {temp++;}
> > lock=append(val-6,temp);if(lock==0) {temp++;}
> > }
> > if(ii<=6)
> > {
> > if(ii<=5)
> > {
> > lock=append(val+15,temp);if(lock==0) {temp++;}
> > lock=append(val+17,temp);if(lock==0) {temp++;}
> > }
> > lock=append(val+6,temp);if(lock==0) {temp++;}
> > lock=append(val+10,temp);if(lock==0) {temp++;}
> > }
> > }
> > lock=append(-1,temp);
> > code:
> > if(location[row_loc][1]==-1)
> > {
> > ii=location[row_loc][0]/8;
> > jj=location[row_loc][0]%8;
> > chess[ii][jj]=0;
> > row_loc--;
> > if(row_loc<0) {cout<<"NO
> > SOLUTION";system("pause");exit(0);}
> > for(int m=1;m<9;m++)
> > location[row_loc][m]=location[row_loc][m+1];
> > goto code;
> > }
> > return location[row_loc][1];
> > }
> > void knight::refresh(void)
> > {
> > int l,tot;
> > l=tot=0;
> > for(int m=0;m<64;m++)
> > denied[m]=99;
> > for(int m=0;m<8;m++)
> > {
> > for(int n=0;n<8;n++)
> > {
> > if(chess[m][n]==1)
> > {
> > if(l==63)
> > {
> > cout<<"RESULT :"<<endl;
> > for(int k=0;k<64;k++)
> > cout<<denied[k]<<" ";
> > system("pause");
> > exit(0);
> > }
> > tot=n+(8*m);
> > denied[l]=tot;
> > l++;
> > }
> > }
> > }
> > }
> > int knight::append(int val1,int temp1)
> > {
> > int lock=0;
> > for(int m=0;m<64;m++)
> > if(denied[m]==val1)
> > {lock=1;break;}
> > if(!lock)
> > location[row_loc][temp1]=val1;
> > return lock;
> > }
> > void main()
> > {knight k;}
>
>int main()
>
>
>Ioannis
>
>* Ioannis Vranos
>* Programming pages: http://www.noicys.d2g.com
>* Alternative URL: http://run.to/noicys
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
|
|
From: Jack Y. <jy...@tw...> - 2002-03-07 14:21:49
|
Hello Jonathan On 06-Mar-02, Jonathan & Brigitte wrote: > Hi guys, > Just a little suggestion, could you please try to send > plain-text emails only to the list? > > Since I get the list in digest format, it is made quite difficult to > read when I have the email usually first in plain-text, then in HTML > code which I have to scroll past, and then when you have several replies > you haven't deleted from the bottom of your email, the problem is > compounded - making it especially hard to find the start of the next > real new message. Oooh, you've touched on a sure spot here. :) >>RAVING MODE ON I completely agree. HTML has no place in lists such as this and it is considered bad netiquette when used. And it is very annoying to those that know how to use the medium properly. Unfortunately most are probably not aware of this or even that the option can be turned off in their email program. There is also the problem of top posting and over quoting. The former is where you place your reply at the beginning of the message as opposed to after it. The latter being where a complete message is repeated even though the replier is only replying to certain parts of it. The worst is when there is an exceptionally long post and someone responds to it, re-posting the complete message with the reply "I agree." And finally, I suppose, one would have to mention posting messages that are way OT. ;) So I'll be quiet now. >>RAVING MODE OFF Jack -- E-Mail: jy...@tw... Alt: jy...@vo... Home: http://my.voyager.net/~jyork |
|
From: Santiago P. C. <San...@yd...> - 2002-03-07 14:09:41
|
Hi to *,
There's NO compiler defect (with this issue), so... Don't panic! ;o)
The variables 'i' & 'j' are class' members, defined on line:
> int row_loc,pos,i,j;
Just my 2 cents, regards
Santy
-----Original Message-----
From: Ioannis Vranos [mailto:no...@ya...]
Sent: Thursday, March 07, 2002 2:21 PM
To: Dev-C++
Subject: RE: [Dev-C++] reg-Knight's tour problem
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Mohammed Riyaz
> Sent: Thursday, March 07, 2002 2:00 PM
> To: dev...@li...
> Subject: [Dev-C++] reg-Knight's tour problem
>
>
> hey,
> I had a look at the code sent in. Am new to programming, my
> code sux when
> compared to that. :D .If any one of you cud fix this code
> ,help me out. -Riyaz
>
> #include <iostream.h>
> #include <stdlib.h>
Useless
> #include <process.h>
Pre-ANSI header file declaration
> class knight
> {
> int chess[8][8],location[65][10],denied[64];
> int row_loc,pos,i,j;
> public:
> knight();
> void assignment(void);
> int value(int);
> void refresh(void);
> int append(int ,int);
> };
> knight::knight(void)
> {
> row_loc=-1;
> i=j=0;
> for(int m=0;m<8;m++)
> for(int n=0;n<8;n++)
> chess[m][n]=0;
> for(int m=0;m<65;m++)
> for(int n=0;n<10;n++)
> location[m][n]=0;
> for(int m=0;m<64;m++)
> denied[m]=99;
> assignment();
> }
> void knight::assignment(void)
> {
> chess[i][j]=1;
Where are i, j defined? Strangely it compiles in MINGW32!!!! (compiler
defect).
> refresh();
> pos=value(j+(8*i));
> i=pos/8;
> j=pos%8;
> assignment();
// Recursion never ends!
> }
> int knight::value(int val)
> {
> row_loc++;
> int temp=1;
> int lock,ii,jj;
> location[row_loc][0]=val;
> ii=val/8;
> jj=val%8;
> if(jj==0)
> {
> if(ii>=1)
> {
> if(ii>=2)
> {lock=append(val-15,temp);if(lock==0) {temp++;}}
> lock=append(val-6,temp);if(lock==0) {temp++;}
> }
> if(ii<=6)
> {
> if(ii<=5)
> {lock=append(val+17,temp);if(lock==0) {temp++;}}
> lock=append(val+10,temp);if(lock==0) {temp++;}
> }
> }
> if(jj==7)
> {
> if(ii>=1)
> {
> if(ii>=2)
> {lock=append(val-17,temp);if(lock==0) {temp++;}}
> lock=append(val-10,temp);if(lock==0) {temp++;}
> }
> if(ii<=6)
> {
> if(ii<=5)
> {lock=append(val+15,temp);if(lock==0) {temp++;}}
> lock=append(val+6,temp);if(lock==0) {temp++;}
> }
> }
> if(jj==1)
> {
> if(ii>=1)
> {
> if(ii>=2)
> {
> lock=append(val-15,temp);if(lock==0) {temp++;}
> lock=append(val-17,temp);if(lock==0) {temp++;}
> }
> lock=append(val-6,temp);if(lock==0) {temp++;}
> }
> if(ii<=6)
> {
> if(ii<=5)
> {
> lock=append(val+17,temp);if(lock==0) {temp++;}
> lock=append(val+15,temp);if(lock==0) {temp++;}
> }
> lock=append(val+10,temp);if(lock==0) {temp++;}
> }
> }
> if(jj==6)
> {
> if(ii>=1)
> {
> if(ii>=2)
> {
> lock=append(val-15,temp);if(lock==0) {temp++;}
> lock=append(val-17,temp);if(lock==0) {temp++;}
> }
> lock=append(val-10,temp);if(lock==0) {temp++;}
> }
> if(ii<=6)
> {
> if(ii<=5)
> {
> lock=append(val+17,temp);if(lock==0) {temp++;}
> lock=append(val+15,temp);if(lock==0) {temp++;}
> }
> lock=append(val+6,temp);if(lock==0) {temp++;}
> }
> }
> if(jj>1 && jj<6)
> {
> if(ii>=1)
> {
> if(ii>=2)
> {
> lock=append(val-17,temp);if(lock==0) {temp++;}
> lock=append(val-15,temp);if(lock==0) {temp++;}
> }
> lock=append(val-10,temp);if(lock==0) {temp++;}
> lock=append(val-6,temp);if(lock==0) {temp++;}
> }
> if(ii<=6)
> {
> if(ii<=5)
> {
> lock=append(val+15,temp);if(lock==0) {temp++;}
> lock=append(val+17,temp);if(lock==0) {temp++;}
> }
> lock=append(val+6,temp);if(lock==0) {temp++;}
> lock=append(val+10,temp);if(lock==0) {temp++;}
> }
> }
> lock=append(-1,temp);
> code:
> if(location[row_loc][1]==-1)
> {
> ii=location[row_loc][0]/8;
> jj=location[row_loc][0]%8;
> chess[ii][jj]=0;
> row_loc--;
> if(row_loc<0) {cout<<"NO
> SOLUTION";system("pause");exit(0);}
> for(int m=1;m<9;m++)
> location[row_loc][m]=location[row_loc][m+1];
> goto code;
> }
> return location[row_loc][1];
> }
> void knight::refresh(void)
> {
> int l,tot;
> l=tot=0;
> for(int m=0;m<64;m++)
> denied[m]=99;
> for(int m=0;m<8;m++)
> {
> for(int n=0;n<8;n++)
> {
> if(chess[m][n]==1)
> {
> if(l==63)
> {
> cout<<"RESULT :"<<endl;
> for(int k=0;k<64;k++)
> cout<<denied[k]<<" ";
> system("pause");
> }
> tot=n+(8*m);
> denied[l]=tot;
> l++;
> }
> }
> }
> }
> int knight::append(int val1,int temp1)
> {
> int lock=0;
> for(int m=0;m<64;m++)
> if(denied[m]==val1)
> {lock=1;break;}
> if(!lock)
> location[row_loc][temp1]=val1;
> return lock;
> }
> void main()
> {knight k;}
int main()
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
--------------------------------------------------------------------------------------
This message and any files transmitted with it are confidential and intended solely
for the use of the individual or entity to whom they are addressed. No confidentiality
or privilege is waived or lost by any wrong transmission.
If you have received this message in error, please immediately destroy it and kindly
notify the sender by reply email.
You must not, directly or indirectly, use, disclose, distribute, print, or copy any
part of this message if you are not the intended recipient. Opinions, conclusions and
other information in this message that do not relate to the official business of
People Communications S.A. shall be understood as neither given nor endorsed by it.
--------------------------------------------------------------------------------------
|
|
From: Ioannis V. <no...@ya...> - 2002-03-07 13:20:56
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Mohammed Riyaz
> Sent: Thursday, March 07, 2002 2:00 PM
> To: dev...@li...
> Subject: [Dev-C++] reg-Knight's tour problem
>
>
> hey,
> I had a look at the code sent in. Am new to programming, my
> code sux when
> compared to that. :D .If any one of you cud fix this code
> ,help me out. -Riyaz
>
> #include <iostream.h>
> #include <stdlib.h>
Useless
> #include <process.h>
Pre-ANSI header file declaration
> class knight
> {
> int chess[8][8],location[65][10],denied[64];
> int row_loc,pos,i,j;
> public:
> knight();
> void assignment(void);
> int value(int);
> void refresh(void);
> int append(int ,int);
> };
> knight::knight(void)
> {
> row_loc=-1;
> i=j=0;
> for(int m=0;m<8;m++)
> for(int n=0;n<8;n++)
> chess[m][n]=0;
> for(int m=0;m<65;m++)
> for(int n=0;n<10;n++)
> location[m][n]=0;
> for(int m=0;m<64;m++)
> denied[m]=99;
> assignment();
> }
> void knight::assignment(void)
> {
> chess[i][j]=1;
Where are i, j defined? Strangely it compiles in MINGW32!!!! (compiler
defect).
> refresh();
> pos=value(j+(8*i));
> i=pos/8;
> j=pos%8;
> assignment();
// Recursion never ends!
> }
> int knight::value(int val)
> {
> row_loc++;
> int temp=1;
> int lock,ii,jj;
> location[row_loc][0]=val;
> ii=val/8;
> jj=val%8;
> if(jj==0)
> {
> if(ii>=1)
> {
> if(ii>=2)
> {lock=append(val-15,temp);if(lock==0) {temp++;}}
> lock=append(val-6,temp);if(lock==0) {temp++;}
> }
> if(ii<=6)
> {
> if(ii<=5)
> {lock=append(val+17,temp);if(lock==0) {temp++;}}
> lock=append(val+10,temp);if(lock==0) {temp++;}
> }
> }
> if(jj==7)
> {
> if(ii>=1)
> {
> if(ii>=2)
> {lock=append(val-17,temp);if(lock==0) {temp++;}}
> lock=append(val-10,temp);if(lock==0) {temp++;}
> }
> if(ii<=6)
> {
> if(ii<=5)
> {lock=append(val+15,temp);if(lock==0) {temp++;}}
> lock=append(val+6,temp);if(lock==0) {temp++;}
> }
> }
> if(jj==1)
> {
> if(ii>=1)
> {
> if(ii>=2)
> {
> lock=append(val-15,temp);if(lock==0) {temp++;}
> lock=append(val-17,temp);if(lock==0) {temp++;}
> }
> lock=append(val-6,temp);if(lock==0) {temp++;}
> }
> if(ii<=6)
> {
> if(ii<=5)
> {
> lock=append(val+17,temp);if(lock==0) {temp++;}
> lock=append(val+15,temp);if(lock==0) {temp++;}
> }
> lock=append(val+10,temp);if(lock==0) {temp++;}
> }
> }
> if(jj==6)
> {
> if(ii>=1)
> {
> if(ii>=2)
> {
> lock=append(val-15,temp);if(lock==0) {temp++;}
> lock=append(val-17,temp);if(lock==0) {temp++;}
> }
> lock=append(val-10,temp);if(lock==0) {temp++;}
> }
> if(ii<=6)
> {
> if(ii<=5)
> {
> lock=append(val+17,temp);if(lock==0) {temp++;}
> lock=append(val+15,temp);if(lock==0) {temp++;}
> }
> lock=append(val+6,temp);if(lock==0) {temp++;}
> }
> }
> if(jj>1 && jj<6)
> {
> if(ii>=1)
> {
> if(ii>=2)
> {
> lock=append(val-17,temp);if(lock==0) {temp++;}
> lock=append(val-15,temp);if(lock==0) {temp++;}
> }
> lock=append(val-10,temp);if(lock==0) {temp++;}
> lock=append(val-6,temp);if(lock==0) {temp++;}
> }
> if(ii<=6)
> {
> if(ii<=5)
> {
> lock=append(val+15,temp);if(lock==0) {temp++;}
> lock=append(val+17,temp);if(lock==0) {temp++;}
> }
> lock=append(val+6,temp);if(lock==0) {temp++;}
> lock=append(val+10,temp);if(lock==0) {temp++;}
> }
> }
> lock=append(-1,temp);
> code:
> if(location[row_loc][1]==-1)
> {
> ii=location[row_loc][0]/8;
> jj=location[row_loc][0]%8;
> chess[ii][jj]=0;
> row_loc--;
> if(row_loc<0) {cout<<"NO
> SOLUTION";system("pause");exit(0);}
> for(int m=1;m<9;m++)
> location[row_loc][m]=location[row_loc][m+1];
> goto code;
> }
> return location[row_loc][1];
> }
> void knight::refresh(void)
> {
> int l,tot;
> l=tot=0;
> for(int m=0;m<64;m++)
> denied[m]=99;
> for(int m=0;m<8;m++)
> {
> for(int n=0;n<8;n++)
> {
> if(chess[m][n]==1)
> {
> if(l==63)
> {
> cout<<"RESULT :"<<endl;
> for(int k=0;k<64;k++)
> cout<<denied[k]<<" ";
> system("pause");
> }
> tot=n+(8*m);
> denied[l]=tot;
> l++;
> }
> }
> }
> }
> int knight::append(int val1,int temp1)
> {
> int lock=0;
> for(int m=0;m<64;m++)
> if(denied[m]==val1)
> {lock=1;break;}
> if(!lock)
> location[row_loc][temp1]=val1;
> return lock;
> }
> void main()
> {knight k;}
int main()
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
|
|
From: Mohammed R. <p_m...@ho...> - 2002-03-07 12:00:52
|
hey,
I had a look at the code sent in. Am new to programming, my code sux when
compared to that. :D .If any one of you cud fix this code ,help me
out.
-Riyaz
#include <iostream.h>
#include <stdlib.h>
#include <process.h>
class knight
{
int chess[8][8],location[65][10],denied[64];
int row_loc,pos,i,j;
public:
knight();
void assignment(void);
int value(int);
void refresh(void);
int append(int ,int);
};
knight::knight(void)
{
row_loc=-1;
i=j=0;
for(int m=0;m<8;m++)
for(int n=0;n<8;n++)
chess[m][n]=0;
for(int m=0;m<65;m++)
for(int n=0;n<10;n++)
location[m][n]=0;
for(int m=0;m<64;m++)
denied[m]=99;
assignment();
}
void knight::assignment(void)
{
chess[i][j]=1;
refresh();
pos=value(j+(8*i));
i=pos/8;
j=pos%8;
assignment();
}
int knight::value(int val)
{
row_loc++;
int temp=1;
int lock,ii,jj;
location[row_loc][0]=val;
ii=val/8;
jj=val%8;
if(jj==0)
{
if(ii>=1)
{
if(ii>=2)
{lock=append(val-15,temp);if(lock==0) {temp++;}}
lock=append(val-6,temp);if(lock==0) {temp++;}
}
if(ii<=6)
{
if(ii<=5)
{lock=append(val+17,temp);if(lock==0) {temp++;}}
lock=append(val+10,temp);if(lock==0) {temp++;}
}
}
if(jj==7)
{
if(ii>=1)
{
if(ii>=2)
{lock=append(val-17,temp);if(lock==0) {temp++;}}
lock=append(val-10,temp);if(lock==0) {temp++;}
}
if(ii<=6)
{
if(ii<=5)
{lock=append(val+15,temp);if(lock==0) {temp++;}}
lock=append(val+6,temp);if(lock==0) {temp++;}
}
}
if(jj==1)
{
if(ii>=1)
{
if(ii>=2)
{
lock=append(val-15,temp);if(lock==0) {temp++;}
lock=append(val-17,temp);if(lock==0) {temp++;}
}
lock=append(val-6,temp);if(lock==0) {temp++;}
}
if(ii<=6)
{
if(ii<=5)
{
lock=append(val+17,temp);if(lock==0) {temp++;}
lock=append(val+15,temp);if(lock==0) {temp++;}
}
lock=append(val+10,temp);if(lock==0) {temp++;}
}
}
if(jj==6)
{
if(ii>=1)
{
if(ii>=2)
{
lock=append(val-15,temp);if(lock==0) {temp++;}
lock=append(val-17,temp);if(lock==0) {temp++;}
}
lock=append(val-10,temp);if(lock==0) {temp++;}
}
if(ii<=6)
{
if(ii<=5)
{
lock=append(val+17,temp);if(lock==0) {temp++;}
lock=append(val+15,temp);if(lock==0) {temp++;}
}
lock=append(val+6,temp);if(lock==0) {temp++;}
}
}
if(jj>1 && jj<6)
{
if(ii>=1)
{
if(ii>=2)
{
lock=append(val-17,temp);if(lock==0) {temp++;}
lock=append(val-15,temp);if(lock==0) {temp++;}
}
lock=append(val-10,temp);if(lock==0) {temp++;}
lock=append(val-6,temp);if(lock==0) {temp++;}
}
if(ii<=6)
{
if(ii<=5)
{
lock=append(val+15,temp);if(lock==0) {temp++;}
lock=append(val+17,temp);if(lock==0) {temp++;}
}
lock=append(val+6,temp);if(lock==0) {temp++;}
lock=append(val+10,temp);if(lock==0) {temp++;}
}
}
lock=append(-1,temp);
code:
if(location[row_loc][1]==-1)
{
ii=location[row_loc][0]/8;
jj=location[row_loc][0]%8;
chess[ii][jj]=0;
row_loc--;
if(row_loc<0) {cout<<"NO SOLUTION";system("pause");exit(0);}
for(int m=1;m<9;m++)
location[row_loc][m]=location[row_loc][m+1];
goto code;
}
return location[row_loc][1];
}
void knight::refresh(void)
{
int l,tot;
l=tot=0;
for(int m=0;m<64;m++)
denied[m]=99;
for(int m=0;m<8;m++)
{
for(int n=0;n<8;n++)
{
if(chess[m][n]==1)
{
if(l==63)
{
cout<<"RESULT :"<<endl;
for(int k=0;k<64;k++)
cout<<denied[k]<<" ";
system("pause");
}
tot=n+(8*m);
denied[l]=tot;
l++;
}
}
}
}
int knight::append(int val1,int temp1)
{
int lock=0;
for(int m=0;m<64;m++)
if(denied[m]==val1)
{lock=1;break;}
if(!lock)
location[row_loc][temp1]=val1;
return lock;
}
void main()
{knight k;}
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
|
|
From: Zodiaq <zo...@ac...> - 2002-03-07 09:48:20
|
Hello all, I'm starting my journey with WinAPI and I do have some problems... for about 3 days I'm trying to make a modal dialog box with tab control inside and with 3 tabs - for each one separate modeless dailog... and I can't just made it work... well I've created main dialog and added tab control, even succeded to add 3 tabs... but I just can't figure out how to add modeless dialogs for each tab - I know that I have to show proper one when user changes tab... If anyone have i minute to spare just look at my code, it's zipped and can be downloaded here: http://www.astercity.net/~piotreq/TabbedDialogBox.zip it's only 11kB big... I'm only looking for explanations how to show first modeless dialog box inside the tab... I think when this will work I'll be able to handle rest... -- regards Zodiaq... |
|
From: <gi...@li...> - 2002-03-07 04:28:52
|
Hello, probably the question is a bit OT, hope you don't mind. I do not know what a "digest format" is, could someone give me a short explanation/example? Thanks. At 12:43 06/03/02 +0800, Jonathan & Brigitte wrote: >Hi guys, > Just a little suggestion, could you please try to send > plain-text emails only to the list? > >Since I get the list in digest format ... -- gisan gi...@li... |
|
From: Ioannis V. <no...@ya...> - 2002-03-07 01:59:12
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Jason Hardman > Sent: Thursday, March 07, 2002 3:17 AM > To: Dev-C++ > Subject: Re: [Dev-C++] help > > > I recieved one copy of Brians last e-mail from Dev-C++ and > one direct. The one that came direct was complete and works. > I'll attach it to this, but I'll leave off the exe as it > compiles fine, and I assume the people on the list have a C++ Thanks Jason. > compiler lying around somewhere. :-D Maybe sending files > larger than a certain size isn't possible through the mailing list. And then how did i receive it ok from your email? :) > I assume this is a different copy to the one you have been > having the problems with? If you still want help with that > then you need to send us some representative code. We don't > try to fix code that already works. The particular happens to compile but it is not portable (not even guaranteed to compile in the future). And this because it uses preANSI syntax. Also it is written in C style but anyway it is a good job. :) Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys |
|
From: Jason H. <jas...@bt...> - 2002-03-07 01:17:20
|
I recieved one copy of Brians last e-mail from Dev-C++ and one direct. The one that came direct was complete and works. I'll attach it to this, but I'll leave off the exe as it compiles fine, and I assume the people on the list have a C++ compiler lying around somewhere. :-D Maybe sending files larger than a certain size isn't possible through the mailing list. I assume this is a different copy to the one you have been having the problems with? If you still want help with that then you need to send us some representative code. We don't try to fix code that already works. Jason. ----- Original Message ----- From: "Ioannis Vranos" <no...@ya...> To: "Dev-C++" <dev...@li...> Sent: Wednesday, March 06, 2002 10:57 PM Subject: RE: [Dev-C++] help > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...] On Behalf > > Of Brian McCall > > Sent: Thursday, March 07, 2002 12:45 AM > > To: dev...@li... > > Subject: Re: [Dev-C++] help > > > > > > I don't know anything about stack faults, but i do have a > > knight's tour > > program that runs without any kind of illegal operations and > > doesn't use > > recursive functions. It also works just about all the time. > > take a look if > > you want. > > > It is empty! Also it doesn't compile. Is that a joke? > > > > Ioannis > > * Ioannis Vranos > * Programming pages: http://www.noicys.d2g.com > * Alternative URL: http://run.to/noicys > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Ioannis V. <no...@ya...> - 2002-03-06 22:57:36
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Brian McCall > Sent: Thursday, March 07, 2002 12:45 AM > To: dev...@li... > Subject: Re: [Dev-C++] help > > > I don't know anything about stack faults, but i do have a > knight's tour > program that runs without any kind of illegal operations and > doesn't use > recursive functions. It also works just about all the time. > take a look if > you want. It is empty! Also it doesn't compile. Is that a joke? Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys |
|
From: Brian M. <str...@ho...> - 2002-03-06 22:44:57
|
I don't know anything about stack faults, but i do have a knight's tour program that runs without any kind of illegal operations and doesn't use recursive functions. It also works just about all the time. take a look if you want. >From: "Jason Hardman" <jas...@bt...> >To: "Dev-C++" <dev...@li...>, "Mohammed Riyaz" ><p_m...@ho...> >Subject: Re: [Dev-C++] help >Date: Wed, 6 Mar 2002 16:24:43 -0000 > >I couldn't tell you exactly what the problem is without the seeing the >source code, which I'm interested in doing anyway as it's not a problem >I've >come across before. However I can suggest what may be the cause. By any >chance is the algorithm used a recursive one? That could be one reason you >are getting a 'stack fault' as every time you call a method you are >creating >a new set of instance variables (amongst other things) on the stack for it, >and there is only a limited amount of space allocated to the stack usualy. >Notice that in both versions the stack pointer (ESP) is about 00560000h >which is about 5 Meg assuming it started a zero. I think on intel machines >that is the case? > >There may be another cause but that seems the most likely. If you are using >a recursive function then try to reimplement it in a non-recursive manner, >it will be faster that way too. > >If recursive calls are the cause, then this fault also suggests that there >may be an error in the termination condition of the function(s), so you are >going through an infinite number of recursive calls, although it may just >be >that the algorithm requires so many calls that the termination condition >would never be met before a stack overflow. > >This is all just a stab in the dark without seeing the code, but I hope it >helps. > >Jason > >----- Original Message ----- >From: "Mohammed Riyaz" <p_m...@ho...> >To: <dev...@li...> >Sent: Wednesday, March 06, 2002 7:43 AM >Subject: [Dev-C++] help > > > > > > Hey guys, > > > > i wrote a program to solve the knight's problem.(move to every block on >the > > chess board using the knight's movements, but never reach the same block > > twice.) > > > > I feel though i coded the program right my system is unable to run the > > program. > > > > In order to test it i compiled the program with two compilers, as a >result > > both the exe files gave errors. but the exe file created by dev-c++ >compiler > > ran longer than the other(i.e it could try more to reach the result). > > > > the error message for both theexe files was > > " this program has performed an illegal operation and will be shut down" > > > > but the details causing the error were diffrent in the either case: > > > > When compiled with Dev-c++ compiler: > > > > KNIGHT caused a stack fault in module KERNEL32.DLL at 0167:bff7a2a1. > > Registers: > > EAX=0054fffc CS=0167 EIP=bff7a2a1 EFLGS=00000216 > > EBX=78037780 SS=016f ESP=00552018 EBP=00552024 > > ECX=c1413f00 DS=016f ESI=00000024 FS=4d3f > > EDX=bffc9490 ES=016f EDI=81661bc0 GS=0000 > > Bytes at CS:EIP: > > 58 5f 8b e5 5d c3 a1 e8 9c fc bf 8b 08 ff 41 38 > > Stack dump: > > 81660a14 00000002 c1413f00 00552044 bff75d40 00000002 00000024 78037780 > > bffa0001 81660a14 00000000 00552480 78011eb2 0000000c 0055206c 00000002 > > > > > > > > When compiled with borland v5.5 compiler: > > > > KNIGHT caused a stack fault in module KNI.EXE at 0167:0041557a. > > Registers: > > EAX=00000006 CS=0167 EIP=0041557a EFLGS=00010206 > > EBX=00562018 SS=016f ESP=00562000 EBP=0056205c > > ECX=005624f1 DS=016f ESI=005624f1 FS=4d1f > > EDX=00000000 ES=016f EDI=0000000a GS=0000 > > Bytes at CS:EIP: > > 55 53 56 57 8b 5c 24 14 8b 4c 24 18 0b c9 75 08 > > Stack dump: > > 00415991 0000000a 00000000 00000024 005625e6 00562664 004159a4 0000000a > > 00000000 00000024 005625fe 00562664 00000001 00000020 0056260e 00562664 > > > > > > cud some one tell me what i cud do? > > i didnt use dynamic memory allocation in my program. > > -riyaz > > > > ======================================================================== > > P.Mohammed riyaz > > Student, Computer Science And Engineering > > ======================================================================== > > > > > > _________________________________________________________________ > > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > > > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com |
|
From: Jason H. <jas...@bt...> - 2002-03-06 16:29:34
|
I couldn't tell you exactly what the problem is without the seeing the source code, which I'm interested in doing anyway as it's not a problem I've come across before. However I can suggest what may be the cause. By any chance is the algorithm used a recursive one? That could be one reason you are getting a 'stack fault' as every time you call a method you are creating a new set of instance variables (amongst other things) on the stack for it, and there is only a limited amount of space allocated to the stack usualy. Notice that in both versions the stack pointer (ESP) is about 00560000h which is about 5 Meg assuming it started a zero. I think on intel machines that is the case? There may be another cause but that seems the most likely. If you are using a recursive function then try to reimplement it in a non-recursive manner, it will be faster that way too. If recursive calls are the cause, then this fault also suggests that there may be an error in the termination condition of the function(s), so you are going through an infinite number of recursive calls, although it may just be that the algorithm requires so many calls that the termination condition would never be met before a stack overflow. This is all just a stab in the dark without seeing the code, but I hope it helps. Jason ----- Original Message ----- From: "Mohammed Riyaz" <p_m...@ho...> To: <dev...@li...> Sent: Wednesday, March 06, 2002 7:43 AM Subject: [Dev-C++] help > > Hey guys, > > i wrote a program to solve the knight's problem.(move to every block on the > chess board using the knight's movements, but never reach the same block > twice.) > > I feel though i coded the program right my system is unable to run the > program. > > In order to test it i compiled the program with two compilers, as a result > both the exe files gave errors. but the exe file created by dev-c++ compiler > ran longer than the other(i.e it could try more to reach the result). > > the error message for both theexe files was > " this program has performed an illegal operation and will be shut down" > > but the details causing the error were diffrent in the either case: > > When compiled with Dev-c++ compiler: > > KNIGHT caused a stack fault in module KERNEL32.DLL at 0167:bff7a2a1. > Registers: > EAX=0054fffc CS=0167 EIP=bff7a2a1 EFLGS=00000216 > EBX=78037780 SS=016f ESP=00552018 EBP=00552024 > ECX=c1413f00 DS=016f ESI=00000024 FS=4d3f > EDX=bffc9490 ES=016f EDI=81661bc0 GS=0000 > Bytes at CS:EIP: > 58 5f 8b e5 5d c3 a1 e8 9c fc bf 8b 08 ff 41 38 > Stack dump: > 81660a14 00000002 c1413f00 00552044 bff75d40 00000002 00000024 78037780 > bffa0001 81660a14 00000000 00552480 78011eb2 0000000c 0055206c 00000002 > > > > When compiled with borland v5.5 compiler: > > KNIGHT caused a stack fault in module KNI.EXE at 0167:0041557a. > Registers: > EAX=00000006 CS=0167 EIP=0041557a EFLGS=00010206 > EBX=00562018 SS=016f ESP=00562000 EBP=0056205c > ECX=005624f1 DS=016f ESI=005624f1 FS=4d1f > EDX=00000000 ES=016f EDI=0000000a GS=0000 > Bytes at CS:EIP: > 55 53 56 57 8b 5c 24 14 8b 4c 24 18 0b c9 75 08 > Stack dump: > 00415991 0000000a 00000000 00000024 005625e6 00562664 004159a4 0000000a > 00000000 00000024 005625fe 00562664 00000001 00000020 0056260e 00562664 > > > cud some one tell me what i cud do? > i didnt use dynamic memory allocation in my program. > -riyaz > > ======================================================================== > P.Mohammed riyaz > Student, Computer Science And Engineering > ======================================================================== > > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Daniel G. <sp...@ho...> - 2002-03-06 12:27:02
|
<html><div style='background-color:'><DIV> <P>Hmm....I only get it in text, not html. Odd.<BR><BR></P></DIV> <DIV></DIV> <DIV></DIV>>From: Jonathan & Brigitte <JO...@PA...> <DIV></DIV>>To: Dev...@li... <DIV></DIV>>Subject: [Dev-C++] A suggestion <DIV></DIV>>Date: Wed, 06 Mar 2002 12:43:02 +0800 <DIV></DIV>> <DIV></DIV>>Hi guys, <DIV></DIV>> Just a little suggestion, could you please try to send <DIV></DIV>>plain-text emails only to the list? <DIV></DIV>> <DIV></DIV>>Since I get the list in digest format, it is made quite difficult to <DIV></DIV>>read when I have the email usually first in plain-text, then in HTML <DIV></DIV>>code which I have to scroll past, and then when you have several <DIV></DIV>>replies <DIV></DIV>>you haven't deleted from the bottom of your email, the problem is <DIV></DIV>>compounded - making it especially hard to find the start of the next <DIV></DIV>>real new message. <DIV></DIV>> <DIV></DIV>>Thanks, <DIV></DIV>>Jonathan. <DIV></DIV>> <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>Join the worlds largest e-mail service with MSN Hotmail. <a href='http://g.msn.com/1HM105301/15'>Click Here</a><br></html> |
|
From: Ioannis V. <no...@ya...> - 2002-03-06 12:12:13
|
We must see the source code, send it in the list. 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 Mohammed Riyaz > Sent: Wednesday, March 06, 2002 9:44 AM > To: dev...@li... > Subject: [Dev-C++] help > > > > Hey guys, > > i wrote a program to solve the knight's problem.(move to > every block on the > chess board using the knight's movements, but never reach the > same block > twice.) > > I feel though i coded the program right my system is unable > to run the > program. > > In order to test it i compiled the program with two > compilers, as a result > both the exe files gave errors. but the exe file created by > dev-c++ compiler > ran longer than the other(i.e it could try more to reach the result). > > the error message for both theexe files was > " this program has performed an illegal operation and will be > shut down" > > but the details causing the error were diffrent in the either case: > > When compiled with Dev-c++ compiler: > > KNIGHT caused a stack fault in module KERNEL32.DLL at 0167:bff7a2a1. > Registers: > EAX=0054fffc CS=0167 EIP=bff7a2a1 EFLGS=00000216 > EBX=78037780 SS=016f ESP=00552018 EBP=00552024 > ECX=c1413f00 DS=016f ESI=00000024 FS=4d3f > EDX=bffc9490 ES=016f EDI=81661bc0 GS=0000 > Bytes at CS:EIP: > 58 5f 8b e5 5d c3 a1 e8 9c fc bf 8b 08 ff 41 38 > Stack dump: > 81660a14 00000002 c1413f00 00552044 bff75d40 00000002 > 00000024 78037780 > bffa0001 81660a14 00000000 00552480 78011eb2 0000000c > 0055206c 00000002 > > > > When compiled with borland v5.5 compiler: > > KNIGHT caused a stack fault in module KNI.EXE at 0167:0041557a. > Registers: > EAX=00000006 CS=0167 EIP=0041557a EFLGS=00010206 > EBX=00562018 SS=016f ESP=00562000 EBP=0056205c > ECX=005624f1 DS=016f ESI=005624f1 FS=4d1f > EDX=00000000 ES=016f EDI=0000000a GS=0000 > Bytes at CS:EIP: > 55 53 56 57 8b 5c 24 14 8b 4c 24 18 0b c9 75 08 > Stack dump: > 00415991 0000000a 00000000 00000024 005625e6 00562664 > 004159a4 0000000a > 00000000 00000024 005625fe 00562664 00000001 00000020 > 0056260e 00562664 > > > cud some one tell me what i cud do? > i didnt use dynamic memory allocation in my program. > -riyaz > > ============================================================== > ========== > P.Mohammed riyaz > Student, Computer Science And Engineering > ============================================================== > ========== > > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Mohammed R. <p_m...@ho...> - 2002-03-06 07:44:16
|
Hey guys, i wrote a program to solve the knight's problem.(move to every block on the chess board using the knight's movements, but never reach the same block twice.) I feel though i coded the program right my system is unable to run the program. In order to test it i compiled the program with two compilers, as a result both the exe files gave errors. but the exe file created by dev-c++ compiler ran longer than the other(i.e it could try more to reach the result). the error message for both theexe files was " this program has performed an illegal operation and will be shut down" but the details causing the error were diffrent in the either case: When compiled with Dev-c++ compiler: KNIGHT caused a stack fault in module KERNEL32.DLL at 0167:bff7a2a1. Registers: EAX=0054fffc CS=0167 EIP=bff7a2a1 EFLGS=00000216 EBX=78037780 SS=016f ESP=00552018 EBP=00552024 ECX=c1413f00 DS=016f ESI=00000024 FS=4d3f EDX=bffc9490 ES=016f EDI=81661bc0 GS=0000 Bytes at CS:EIP: 58 5f 8b e5 5d c3 a1 e8 9c fc bf 8b 08 ff 41 38 Stack dump: 81660a14 00000002 c1413f00 00552044 bff75d40 00000002 00000024 78037780 bffa0001 81660a14 00000000 00552480 78011eb2 0000000c 0055206c 00000002 When compiled with borland v5.5 compiler: KNIGHT caused a stack fault in module KNI.EXE at 0167:0041557a. Registers: EAX=00000006 CS=0167 EIP=0041557a EFLGS=00010206 EBX=00562018 SS=016f ESP=00562000 EBP=0056205c ECX=005624f1 DS=016f ESI=005624f1 FS=4d1f EDX=00000000 ES=016f EDI=0000000a GS=0000 Bytes at CS:EIP: 55 53 56 57 8b 5c 24 14 8b 4c 24 18 0b c9 75 08 Stack dump: 00415991 0000000a 00000000 00000024 005625e6 00562664 004159a4 0000000a 00000000 00000024 005625fe 00562664 00000001 00000020 0056260e 00562664 cud some one tell me what i cud do? i didnt use dynamic memory allocation in my program. -riyaz ======================================================================== P.Mohammed riyaz Student, Computer Science And Engineering ======================================================================== _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com |
|
From: Jonathan & B. <jo...@pa...> - 2002-03-06 04:48:25
|
Hi guys,
Just a little suggestion, could you please try to send
plain-text emails only to the list?
Since I get the list in digest format, it is made quite difficult to
read when I have the email usually first in plain-text, then in HTML
code which I have to scroll past, and then when you have several replies
you haven't deleted from the bottom of your email, the problem is
compounded - making it especially hard to find the start of the next
real new message.
Thanks,
Jonathan.
|
|
From: Samuel K. <big...@ya...> - 2002-03-06 01:42:36
|
Hey, To be trueful, you have to make up your own mind.There our tons of langs. out there, each with their own benefits. If you get a good book, it can teach you to do structured programming in C or C++. Whatever you do, you are going to have a lot of work to do on your own. There isn't nothing that is to hard to understand as long as you have a compiler/interpeter and a good book or tutorial. Some people will talk about how hard pointers are. There only hard if you don't point any work in understanding them at all. I am not even an intermediate programming, but I can understand the ideas behind pointers just from doing a little reading on them. Even I used any more time on them, I could even program with them. The only problem I have is I am wasting time on other stuff like my classes in college. When I first started out I played with GW Basic, later C++. I learned as much as I put time in them. The main question is are you willing to put out the time necassary to learn a new lang., and do you have the time. Someone else made the lang. unless they did a sorry job, you should be able to learn it. A language that I would consider is Java, it is built on top of C++ and you can download a free compiler from Sun. Good Luck. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
|
From: Quentin S. <mac...@bi...> - 2002-03-06 00:41:16
|
Hi- a) it does support texture mapping b) no one else has this problem c) no idea HTH, --Quentin On Tuesday, March 5, 2002, at 07:33 PM, Ope...@ao... wrote: > Ive been using Dev-C++4 for at leats 2 months now. Ive been programming > OpenGL/ WIN32 with Dev-C++4.But When I try to texture Map with it it > dont show My texture. Even when I download a sample from a site it dont > show the texture on the object. My system specs are 512MB of RAM, > 1.6GIGZ in speed, a nVidia TNT 2 M64 32MB of RAM AGP graphics card, > WINDOWS XP. So why doesnt it supports Texture Mapping and do anybody > else has this same problem and how did you fix it. > |
|
From: <Ope...@ao...> - 2002-03-06 00:34:00
|
Ive been using Dev-C++4 for at leats 2 months now. Ive been programming OpenGL/ WIN32 with Dev-C++4.But When I try to texture Map with it it dont show My texture. Even when I download a sample from a site it dont show the texture on the object. My system specs are 512MB of RAM, 1.6GIGZ in speed, a nVidia TNT 2 M64 32MB of RAM AGP graphics card, WINDOWS XP. So why doesnt it supports Texture Mapping and do anybody else has this same problem and how did you fix it. |
|
From: Ioannis V. <no...@ya...> - 2002-03-06 00:09:40
|
-----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of h.r...@gm... Sent: Tuesday, March 05, 2002 11:19 PM To: Dev...@li... Subject: Re: [Dev-C++] (no subject) As you said "C++ provides all the paradigms and facilities both high level and low level,..." which I think is actualy a reason for not learning C++ straight off. Also is the fact that C++ is a hybrid language in that it can operate as both a structured language and an OOP language, or a bit of both. When learning an approach it's important that the learner is not confused by the features of a language, and is kept on a 'tight leash' so to say. =20 Another thing that C and C++ does is to expose pointers and references more than most languages, as it is a middle level language. It would be better to start with high level language which doesn't confuse complete newbies with such things. I think pointers are one of the harder concepts that most learning programmers have to get thier heads around at some point, but not right at the beginning. =20 =20 In C++ there is no need to use pointers or references. For simple tasks you can use the provided facilities without bothering for low level stuff: vectors, strings, cin, cout, e.t.c.. If you need to use pointers then you are dealing with advanced concepts not being able to implement them with a simpler language anyway. Also there is no need to learn C! =20 =20 =20 As for C++ being the *best* language, it's a matter of point of view, but I wouldn't say that any language is the best, much the same that any spoken language is the best. When approaching a development you choose the one that is right at the time. An additional benefit of learning Pascal (or some other language) is that you can write on your CV (Resume) that you can program in Pascal (or whatever). I believe that Cobol programmers are very much in demand these days. =20 =20 Knowing C i bought a Pascal book and learned it in 2 days. And this because C's abilities are a superset of Pascal abilities (after all the most Pascal compilers are written in C). After finishing with C++ i think i can learn any programming language of any of C++'s supported paradigms in the same time frame. =20 =20 C++ is not the "best language". It is the "best general purpose programming language". Or if you do not like this, it is the dominant general purpose programming language. :) According to IDC, in 2001 the 1st in use programming language was C++ & C (mainly C++), 2nd was Visual Basic and then the others. =20 I do not underestimate the other languages and their followers but i am just saying the facts. After all if C++ wasn't the best i would not study it in the first place. I wasn't forced to learn C++, i chose to learn it after checking the facts. =20 =20 =20 Ioannis =20 * Ioannis Vranos * Programming pages: <http://www.noicys.d2g.com/> http://www.noicys.d2g.com * Alternative URL: <http://run.to/noicys> http://run.to/noicys |
|
From: Jason H. <jas...@bt...> - 2002-03-05 22:29:30
|
MessageThe original question was: "Pre-high schooler needs information = on how to start learning programming". Learning how to program and = learning a specific language are actualy pretty seperate issues. If fact = you can learn the diciplines of programming without learning the = language at all. Carrying over from the spoken language analogy it's not a matter of = learning english, french or german, but leaning a common grammar (wrong = word?) which can be used between them. A way of structuring the words of = a language to give a particular meaning in a consistent manner. Maybe = it's a bad analogy. The whole idea of learning a way to program is to give you a way of = breaking down a problem to be solved and implementing it in a manner = that is less prone to coding faults. The more complex a system you = design the more time you need to spend on analysis and design and the = less on actualy writing code. I believe it's better to get into good = habits, before forming bad ones. :) Jason. ----- Original Message -----=20 From: h.r...@gm...=20 To: Dev...@li...=20 Sent: Tuesday, March 05, 2002 9:18 PM Subject: Re: [Dev-C++] (no subject) Hi list, sometimes I doesnt understand the discussion, sorry. If I want to learn C++ then I learn C++. Why should it make sense to = learn a other language first ?=20 Nobody else would teach his child french, german or anything other if = he want to teach them english only since it is easyer to learn that. greetings=20 horst=20 --=20 -------------------------- Horst R=F6=DFner Postf. 1802 52205 Stolberg 02402 / 6178 0171 6455636 GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -------------------------------------------------------------------------= ----- As you said "C++ provides all the paradigms and facilities both high = level and low level,..." which I think is actualy a reason for not = learning C++ straight off. Also is the fact that C++ is a hybrid = language in that it can operate as both a structured language and an OOP = language, or a bit of both. When learning an approach it's important = that the learner is not confused by the features of a language, and is = kept on a 'tight leash' so to say. Another thing that C and C++ does is to expose pointers and references = more than most languages, as it is a middle level language. It would be = better to start with high level language which doesn't confuse complete = newbies with such things. I think pointers are one of the harder = concepts that most learning programmers have to get thier heads around = at some point, but not right at the beginning. As for C++ being the *best* language, it's a matter of point of view, = but I wouldn't say that any language is the best, much the same that any = spoken language is the best. When approaching a development you choose = the one that is right at the time. An additional benefit of learning = Pascal (or some other language) is that you can write on your CV = (Resume) that you can program in Pascal (or whatever). I believe that = Cobol programmers are very much in demand these days. Jason. ----- Original Message -----=20 From: Ioannis Vranos=20 To: Dev-C++=20 Sent: Tuesday, March 05, 2002 3:02 PM Subject: RE: [Dev-C++] (no subject) "Learn some easy language", "learn some outdated language", "so as = to get the fundamentals". Sorry guys i strongly disagree with you. My = advice is: Learn the *best* language directly. I started from C = straight, and now i am at C++ and i can suggest to learrn C at all and = go straight at C++. C++ provides all the paradigms and facilities both = high level and low level, so as anyone can learn as much as he wants and = start programming. There is no need to know the whole C++ so as to write = good programs. Also for a newcomer it is very easy to program in C++! Consider the code: #include <iostream> #include <string> int main() { using namespace std; string a=3D"This is my first program."; string b=3D"I wish to become a very good programmer"; string c=3Da+" "+b; cout<<c; } I also suggested a great book which permits to learn C++ rapidly. = "Accelerated C++" by Andrew Koenig, Barbara Moo. I was informed of this = book by BS himself in an email discussion we had on TC++PL. Then i = checked at Amazon and i saw it has good comments. Also i read the = contents and i think they are great too. Then i read the author's page = for the book and i liked it too. In summary a great book. http://www.research.att.com/~ark/bibliography/accelerated.html Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys 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 Benjamin = Wheeless Sent: Tuesday, March 05, 2002 2:59 PM To: nic...@ya...; dev...@li... Subject: Re: [Dev-C++] (no subject) Good morning, Just wanted to chime in here. Jason's opinion on this topic is = right along the same lines as mine. I totally agree that it is = important to learn the fundamentals behind the structure of programming = first. As I mentioned in an email to another person posting this same = question (possibly the same person under a different email address)... = I'd recommend something like Pascal or QBasic to start you off. They = are outdated and are aimed at teaching programming from a console (DOS = window) environment, but they will be excellent at "starting your = journey" as Jason said, into the world of programming. Back when I was in college, the first programming language that = they taught there was Pascal. Then we progressed into C and C++ and = then into learning more about Data Structures, Algorithms, Operating = Systems, etc. Anyway, my point is...start with something small and work = up... QBasic, BASIC, and Pascal are all languages that are great = starting points. Start there, with the basics....and feel free to email should you = have any questions along the way. Benjamin Wheeless Network Systems - Delta Airlines, Inc. Atlanta, GA - USA 30320 = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D ----Original Message Follows----=20 From: Nicole Mark=20 To: dev...@li...=20 Subject: [Dev-C++] (no subject)=20 Date: Mon, 4 Mar 2002 16:01:56 -0800 (PST)=20 Pre-high schooler needs information on how to start learning = programming=20 Thanks=20 ---------------------------------=20 Do You Yahoo!?=20 Yahoo! Sports - Sign up for Fantasy Baseball=20 -------------------------------------------------------------------------= - Send and receive Hotmail on your mobile device: Click Here _______________________________________________ Dev-cpp-users = mailing list Dev...@li... = https://lists.sourceforge.net/lists/listinfo/dev-cpp-users=20 |
|
From: <h.r...@gm...> - 2002-03-05 21:19:07
|
Hi list, sometimes I doesnt understand the discussion, sorry. If I want to learn C++ then I learn C++. Why should it make sense to learn a other language first ? Nobody else would teach his child french, german or anything other if he want to teach them english only since it is easyer to learn that. greetings horst -- -------------------------- Horst Rößner Postf. 1802 52205 Stolberg 02402 / 6178 0171 6455636 GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net |
|
From: Jason H. <jas...@bt...> - 2002-03-05 19:45:41
|
MessageAs you said "C++ provides all the paradigms and facilities both =
high level and low level,..." which I think is actualy a reason for not =
learning C++ straight off. Also is the fact that C++ is a hybrid =
language in that it can operate as both a structured language and an OOP =
language, or a bit of both. When learning an approach it's important =
that the learner is not confused by the features of a language, and is =
kept on a 'tight leash' so to say.
Another thing that C and C++ does is to expose pointers and references =
more than most languages, as it is a middle level language. It would be =
better to start with high level language which doesn't confuse complete =
newbies with such things. I think pointers are one of the harder =
concepts that most learning programmers have to get thier heads around =
at some point, but not right at the beginning.
As for C++ being the *best* language, it's a matter of point of view, =
but I wouldn't say that any language is the best, much the same that any =
spoken language is the best. When approaching a development you choose =
the one that is right at the time. An additional benefit of learning =
Pascal (or some other language) is that you can write on your CV =
(Resume) that you can program in Pascal (or whatever). I believe that =
Cobol programmers are very much in demand these days.
Jason.
----- Original Message -----=20
From: Ioannis Vranos=20
To: Dev-C++=20
Sent: Tuesday, March 05, 2002 3:02 PM
Subject: RE: [Dev-C++] (no subject)
"Learn some easy language", "learn some outdated language", "so as to =
get the fundamentals". Sorry guys i strongly disagree with you. My =
advice is: Learn the *best* language directly. I started from C =
straight, and now i am at C++ and i can suggest to learrn C at all and =
go straight at C++. C++ provides all the paradigms and facilities both =
high level and low level, so as anyone can learn as much as he wants and =
start programming. There is no need to know the whole C++ so as to write =
good programs. Also for a newcomer it is very easy to program in C++!
Consider the code:
#include <iostream>
#include <string>
int main()
{
using namespace std;
string a=3D"This is my first program.";
string b=3D"I wish to become a very good programmer";
string c=3Da+" "+b;
cout<<c;
}
I also suggested a great book which permits to learn C++ rapidly. =
"Accelerated C++" by Andrew Koenig, Barbara Moo. I was informed of this =
book by BS himself in an email discussion we had on TC++PL. Then i =
checked at Amazon and i saw it has good comments. Also i read the =
contents and i think they are great too. Then i read the author's page =
for the book and i liked it too. In summary a great book.
http://www.research.att.com/~ark/bibliography/accelerated.html
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
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 Benjamin =
Wheeless
Sent: Tuesday, March 05, 2002 2:59 PM
To: nic...@ya...; dev...@li...
Subject: Re: [Dev-C++] (no subject)
Good morning,
Just wanted to chime in here. Jason's opinion on this topic is =
right along the same lines as mine. I totally agree that it is =
important to learn the fundamentals behind the structure of programming =
first.
As I mentioned in an email to another person posting this same =
question (possibly the same person under a different email address)... =
I'd recommend something like Pascal or QBasic to start you off. They =
are outdated and are aimed at teaching programming from a console (DOS =
window) environment, but they will be excellent at "starting your =
journey" as Jason said, into the world of programming.
Back when I was in college, the first programming language that they =
taught there was Pascal. Then we progressed into C and C++ and then =
into learning more about Data Structures, Algorithms, Operating Systems, =
etc. Anyway, my point is...start with something small and work up... =
QBasic, BASIC, and Pascal are all languages that are great starting =
points.
Start there, with the basics....and feel free to email should you =
have any questions along the way.
Benjamin Wheeless
Network Systems - Delta Airlines, Inc.
Atlanta, GA - USA 30320
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
----Original Message Follows----=20
From: Nicole Mark=20
To: dev...@li...=20
Subject: [Dev-C++] (no subject)=20
Date: Mon, 4 Mar 2002 16:01:56 -0800 (PST)=20
Pre-high schooler needs information on how to start learning =
programming=20
Thanks=20
---------------------------------=20
Do You Yahoo!?=20
Yahoo! Sports - Sign up for Fantasy Baseball=20
-------------------------------------------------------------------------=
---
Send and receive Hotmail on your mobile device: Click Here
_______________________________________________ Dev-cpp-users =
mailing list Dev...@li... =
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users=20
|
|
From: Lorenzo <co...@in...> - 2002-03-05 16:34:27
|
Hi, From your 2 line i can't understand the problem. i can suggest you to check the value of hButton, If the function CreateWindowsEX fails, the return value is NULL. In attach i have send a little example. I hope that this can help you. ---------------------------------------------------------------------------- --- If debugging is the process of removing bugs, then programming must be the process of putting them in. ---------------------------------------------------------------------------- --- |
|
From: Ioannis V. <no...@ya...> - 2002-03-05 15:04:27
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of David Mcken
> Sent: Tuesday, March 05, 2002 4:15 PM
> To: dev...@li...
> Subject: Re: [Dev-C++] (no subject)
>
Sorry for the "corrections" but i have to. :)
> //Hello world in C
C++
> #include <iostream.h>
#include <iostream>
#include <cstdlib>
>
> int main()
> {
using namespace std;
> cout << "Hello World" << endl;
> system("PAUSE");
> return 0;
> }
>
> As you can see the structure is quite similar and thus when
> you decide to move up to C or C++ the jump is quite small
> (all you have to do is learn different syntax and functions).
> I regret to say that there are not many good books on store
> shelves but you can find quite a few good tutorials on the
> internet(or just write me for help).
>
> (P.S. sorry this was so long I just had to put in my two cents)
Then why not learn C++ directly?
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
|