dev-cpp-users Mailing List for Dev-C++ (Page 206)
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: Gustavo L. <gl...@gr...> - 2004-06-23 20:20:54
|
Does anyone know if ther is a glut (opengl util toolkit) implementation for Devcpp? |
|
From: karthi k. <gen...@ya...> - 2004-06-23 10:52:20
|
Hello friends,
We planned to develop memory subsystem.So we are in
need to create pure binary files,for loading
independently.So can you please help me
"how to create pure binary images with dev-cpp."
and
"how to pass assembler cmd options".
thankyou.
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
|
|
From: karthi k. <gen...@ya...> - 2004-06-23 10:31:34
|
How to produce binary images in windows using ld. How to pass cmd options to dev-cpp. __________________________________ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail |
|
From: David M. <dml...@co...> - 2004-06-23 04:00:50
|
I was wondering if anyone knows a good tutorial or paper on creating new
C++ iostream. I had 2 possible uses for it:
The interface for a queue. << - Insert end, >> - get front.
Wrapper for C I/O (especially compression) API. e.g.
ofstream_bz2 some_file("data.bin"); //.bz2 is added automatically
some_file << "some data"; //Data is automatically compressed in the bz2
format.
All the tutorial I found on google involve a very long complicated
sequence of steps and all seemed to involve the underlying stream buffer.
Thanks in Advance
David McKen
|
|
From: <A_B...@gm...> - 2004-06-22 22:59:15
|
Hi Siva !!! Thanks a 1000K !!! :) I installed these packages, tested the template and it works perfectly !!! But what me confuses a little bit is why the official dev-pack (downloadet from Bloodshed) doesn't work !?!?! Anyway, now it works and nothing else matters !!! :) CU, Acki -------------------------------------- Am 20 Jun 2004 um 19:34 hat Siva Chandra <siv...@ya...> geschrieben: > hello, > > I use wxWindows(wxWidgets) quite often and it all > seems to work fine for me. I downloaded the DevPak > from the following site: > http://michel.weinachter.free.fr/ > > The sample program(or the Dev-C++ Template) has all > the compiler and linker options rightly set. If you > are interested in image manipulation for jpeg, png or > tiff images, then you should include the suitable > header files and link to your libtiff, libjpeg and > libpng libraries. > > To me, your problem looks as if you are not having > proper compiler options set. > > Hope this helps. > > Siva Chandra. -- "Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen! Jetzt aktivieren unter http://www.gmx.net/info |
|
From: Scott S. <age...@co...> - 2004-06-22 21:00:15
|
It means this: If dividing the variable number by 10000 is equal to the variable number modulus 10, AND the variable number divided by 1000 modulus 10 is equal to the variable number divided by 10 modulus 10. Modulus is the remainder left over in division. PETER CAMPOS wrote: >greetings to all >please explain to me the if statement: > >if (((number/10000) == (number%10)) && (((number/1000)%10) == ((number/10) %10))) > >thanx >peter > > >______________ ______________ ______________ ______________ > ccny.cuny.edu > > > > > > >------------------------------------------------------- >This SF.Net email sponsored by Black Hat Briefings & Training. >Attend Black Hat Briefings & Training, Las Vegas July 24-29 - >digital self defense, top technical experts, no vendor pitches, >unmatched networking opportunities. Visit www.blackhat.com >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > |
|
From: Noorez K. <coo...@ho...> - 2004-06-22 17:08:22
|
Is it still possible to use the ios::nocreate and ios::noreplace? _________________________________________________________________ MSN Premium includes powerful parental controls and get 2 months FREE* http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines |
|
From: Jesse H. <jes...@gm...> - 2004-06-22 16:49:37
|
As per, http://www.devx.com/tips/Tip/14544 The following example imitates the ios::nocreate flag. First, it attempts to open a file for read. If the file doesn't exist, no new file is created. If the file exists, the program closes it and reopens it in write mode: fstream fs("fname", ios_base::in);// attempt open for read if (!fs) { // file doesn't exist; don't create a new one } else //ok, file exists. close and reopen in write mode { fs.close(); fs.open("fname", ios_base::out); // reopen for write } You can just do the opposite for ios::noreplace: fstream fs("fname", ios_base::in);// attempt open for read if (!fs) { // file doesn't exist; create a new one fs.open("fname", ios_base::out); } else //ok, file exists; close and reopen in write mode { fs.close() fs.open("fname", ios_base::out); // reopen for write } On Tue, 22 Jun 2004 09:53:49 -0600, Noorez Kassam <coo...@ho...> wrote: > > I tried including the old iostream.h file but it still didn't work. Can you > give me a sample code for this? > > From: Jesse Hallam <jes...@gm...> > To: Noorez Kassam <coo...@ho...> > CC: dev...@li... > Subject: Re: [Dev-C++] File handle > Date: Mon, 21 Jun 2004 20:31:06 -0400 > > > > As per, > > http://www.flipcode.com/cgi-bin/msg.cgi?showThread=00003660&forum=general&id=-1 > > ios::nocreate is only implemented in the old C++ runtime library -- > <iostream.h>, rather than <iostream>. > > There's a detailed list of implementation differences here: > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_differences_in_iostream_implementation.asp > > (I presume this is the same situation with ios::noreplace) > > Cheerio! > > On Mon, 21 Jun 2004 17:05:52 -0600, Noorez Kassam > <coo...@ho...> wrote: > > > > I am having trouble doing file handling. > > > > when opening the file i can use all the opening techinques except > > ios::nocreate and ios::noreplace. > > All the other ones work fine but when i try to use those i get a compile > > error. > > > > _________________________________________________________________ > > Tired of spam? Get advanced junk mail protection with MSN Premium > > > http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines > > > > ------------------------------------------------------- > > This SF.Net email sponsored by Black Hat Briefings & Training. > > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > > digital self defense, top technical experts, no vendor pitches, > > unmatched networking opportunities. Visit www.blackhat.com > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > -- > Jesse Hallam > University of Waterloo Freshman > > _________________________________________________________________ > > > http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines > > -- Jesse Hallam University of Waterloo Freshman |
|
From: A. K. <kli...@ad...> - 2004-06-22 13:40:08
|
David McKen wrote: > When I run the following program on win2k pro it has no problem finding > the input file because when I drag a file on to it windows gives it the > absolute filename. The problem is the executable & the input file are in > a folder on the E drive and the output file is written to c:\Documents > and Settings\david\ . Why do I have to specify the absolute filename > just to get the working directory to the one as the executable? I have Cause the program is run in C:\Dcuments... by windows by default. All console programs are. > an explorer window open to e:\primes and I drag the input file onto the > executable's icon. The program shows no errors, the output is just in > the wrong place. Any simple way to fix? Set the working directory in your program before you open files for writing. You could also set the working directory in the programs shortcut. Alex |
|
From: A. K. <kli...@ad...> - 2004-06-22 13:36:47
|
Franco Brancaccio wrote: > Dear friends, > > I am using Dev-C++ with FLTK to develop Win applications. > I'd like to know how to change the window icon. I'm a beginer and tried > to follow FLTK documentation with no success. Some example code using a > compiled bmp icon (I use FLUID to generate image code) and loading bmp > images will help me. In Project Options - General there is a setting "Icon", use that. Alex |
|
From: Franco B. <fbr...@ip...> - 2004-06-22 11:13:37
|
Dear friends, I am using Dev-C++ with FLTK to develop Win applications. I'd like to know how to change the window icon. I'm a beginer and tried to follow FLTK documentation with no success. Some example code using a compiled bmp icon (I use FLUID to generate image code) and loading bmp images will help me. Thanks in advance. Franco Brancaccio |
|
From: Jesse H. <jes...@gm...> - 2004-06-22 00:31:07
|
As per, http://www.flipcode.com/cgi-bin/msg.cgi?showThread=00003660&forum=general&id=-1 ios::nocreate is only implemented in the old C++ runtime library -- <iostream.h>, rather than <iostream>. There's a detailed list of implementation differences here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_differences_in_iostream_implementation.asp (I presume this is the same situation with ios::noreplace) Cheerio! On Mon, 21 Jun 2004 17:05:52 -0600, Noorez Kassam <coo...@ho...> wrote: > > I am having trouble doing file handling. > > when opening the file i can use all the opening techinques except > ios::nocreate and ios::noreplace. > All the other ones work fine but when i try to use those i get a compile > error. > > _________________________________________________________________ > Tired of spam? Get advanced junk mail protection with MSN Premium > http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > -- Jesse Hallam University of Waterloo Freshman |
|
From: David M. <dml...@co...> - 2004-06-22 00:20:06
|
When I run the following program on win2k pro it has no problem finding
the input file because when I drag a file on to it windows gives it the
absolute filename. The problem is the executable & the input file are in
a folder on the E drive and the output file is written to c:\Documents
and Settings\david\ . Why do I have to specify the absolute filename
just to get the working directory to the one as the executable? I have
an explorer window open to e:\primes and I drag the input file onto the
executable's icon. The program shows no errors, the output is just in
the wrong place. Any simple way to fix?
#include <iostream>
#include <algorithm>
#include <iterator>
#include <fstream>
#include <iomanip>
#include <cstdio>
using namespace std;
char tmp_file[] = "1234.txt";
int main(int argc, char *argv[])
{
if(argc == 2)
{
cout << "Opening " << argv[1] << endl;
ifstream read_from(argv[1]);
ofstream write_to(tmp_file);
int temp, count = 0;
while(!read_from.eof())
{
read_from >> temp;
write_to << temp << endl;
count++;
}
read_from.close();
write_to.close();
//remove(argv[1]);
//rename(tmp_file, argv[1]);
cout << "Done." << count << endl;
}
else
{
cout << "Invalid number of arguments\n";
}
cin.get();
}
|
|
From: Noorez K. <coo...@ho...> - 2004-06-21 23:05:56
|
I am having trouble doing file handling. when opening the file i can use all the opening techinques except ios::nocreate and ios::noreplace. All the other ones work fine but when i try to use those i get a compile error. _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN Premium http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines |
|
From: nuc p. <nuc...@ms...> - 2004-06-21 22:50:55
|
thanx jesse for the explanation. the line makes complete sense now!!
peter
>From: Jesse Hallam <jes...@gm...>
>To: dirty dragon <dir...@ms...>
>CC: dev...@li...
>Subject: Re: [Dev-C++] (no subject)
>Date: Mon, 21 Jun 2004 15:58:40 -0400
>
>Provided number is an integer,
>
>number / 10000 == 1st digit (55255 / 10000 = 5)
>number % 10 == 5th digit (55255 % 10 = 5)
>
>if (number/10000) == (number%10)) checks if the first and last digits are
>equal.
>
>
>(number/1000)%10 == 2nd digit
>(number/10)%10) == 4th digit
>
>if (number/1000)%10 == (number/10)%10 checks if the second and fourth
>digits are equal.
>
>The third digit can be ignored...
>
>Cheerio!
>
>
>
>On Mon, 21 Jun 2004 15:45:12 -0400, dirty dragon <dir...@ms...>
>wrote:
> >
> > can someone please explain the significance of the second if statement?
> > thnx pete
> >
> > if((number>=10000 && number <100000))
> >
> > {
> > if (((number/10000) == (number%10)) && (((number/1000)%10) ==
>((number/10)
> > %10)))
> >
> > cout<<number<<" is a palindrome"<<endl;
> > else
> > cout <<number<<" is not palindrome"<<endl;
> >
> > }
> > else{
> > cout<<"You did not enter a 5-digit number!"<<endl;
> >
> > _________________________________________________________________
> > FREE pop-up blocking with the new MSN Toolbar get it now!
> > http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
> >
> > -------------------------------------------------------
> > This SF.Net email sponsored by Black Hat Briefings & Training.
> > Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
> > digital self defense, top technical experts, no vendor pitches,
> > unmatched networking opportunities. Visit www.blackhat.com
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
>
>--
>Jesse Hallam
>University of Waterloo Freshman
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by Black Hat Briefings & Training.
>Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
>digital self defense, top technical experts, no vendor pitches,
>unmatched networking opportunities. Visit www.blackhat.com
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
MSN 9 Dial-up Internet Access fights spam and pop-ups now 3 months FREE!
http://join.msn.click-url.com/go/onm00200361ave/direct/01/
|
|
From: Per W. <pw...@ia...> - 2004-06-21 20:41:12
|
pow() isn't a very good function to use, since it is using floating point. Floating point and integer arithmetic should be kept apart unless there is really a very strong reason for mixing them. Note also that pow() is a bit expensive function. I would assume that the question here is to sift through large number of primes to locate palindromes. For a lot of programming experience with palindromes and other similar things, see: http://www.mathschallenge.net/index.php?section=project /Per W On Mon, 21 Jun 2004, David McKen wrote: > short get_digit(int number, short place) > { > return (number / pow(10,place)) % 10; > } > > The above code can get you the digit at position x. I think you can > figure it out from there. > > If you want all the digits one time you could use an array > //assume the number you want to test is in an int variable called num. > int digits[5]; > for(int i = 0; i < 5; i++) > { > digits[i] = num % 10; > num = num / 10; > } > > The rest is simple. > > Is this homework? > > dirty dragon wrote: > > > hi everyone, > > trying to write a program which determines a 5 digit integer to be a > > palindrome or not. > > i'd like to use mudulus and division operands to separate parts of a 5 > > digit integer. > > any suggestions? > > > > i posted this on the dev-users forum yesterday but i can't get into > > the forums today. anyone else having trouble? > > > > thanx pete > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: PETER C. <pca...@cc...> - 2004-06-21 20:10:53
|
greetings to all please explain to me the if statement: if (((number/10000) == (number%10)) && (((number/1000)%10) == ((number/10) %10))) thanx peter ______________ ______________ ______________ ______________ ccny.cuny.edu |
|
From: David M. <dml...@co...> - 2004-06-21 20:09:49
|
The noreplace and nocreate flags are no longer part of the C++ standard
(not sure if they ever were part).
Essentially you have to check for the file's existence before trying to
open it and then attempt to open the file accordingly.
Noorez Kassam wrote:
> I marked the error with a comment.
>
> void Quiz::writeQuestion(Quiz ques, int type, char* quizName)
> {
> ofstream out_file(quizName,ios::noreplace); //compiler returns
> error that ios::noreplace doesn't exist.
>
> if(type == 1)
> {
> out_file << "#\n" << questionNumb << ". " << ques.question <<
> '\n';
> out_file << "A. " << ques.answerA << '\n';
> out_file << "B. " << ques.answerB << '\n';
> out_file << "C. " << ques.answerC << '\n';
> out_file << "D. " << ques.answerD << '\n';
> out_file << '#' << ques.actual << '\n';
> }
> if(type == 2)
> {
> out_file << "#\n" << questionNumb << ". " << ques.question <<
> '\n';
> out_file << "True or False\n";
> out_file << '#' << ques.actual << '\n';
> }
> }
>
> I marked the error with a comment.
>
> _________________________________________________________________
> MSN Premium helps eliminate e-mail viruses. Get 2 months FREE*
> http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: David M. <dml...@co...> - 2004-06-21 20:02:54
|
short get_digit(int number, short place)
{
return (number / pow(10,place)) % 10;
}
The above code can get you the digit at position x. I think you can
figure it out from there.
If you want all the digits one time you could use an array
//assume the number you want to test is in an int variable called num.
int digits[5];
for(int i = 0; i < 5; i++)
{
digits[i] = num % 10;
num = num / 10;
}
The rest is simple.
Is this homework?
dirty dragon wrote:
> hi everyone,
> trying to write a program which determines a 5 digit integer to be a
> palindrome or not.
> i'd like to use mudulus and division operands to separate parts of a 5
> digit integer.
> any suggestions?
>
> i posted this on the dev-users forum yesterday but i can't get into
> the forums today. anyone else having trouble?
>
> thanx pete
|
|
From: Jesse H. <jes...@gm...> - 2004-06-21 19:58:41
|
Provided number is an integer,
number / 10000 =3D=3D 1st digit (55255 / 10000 =3D 5)
number % 10 =3D=3D 5th digit (55255 % 10 =3D 5)
if (number/10000) =3D=3D (number%10)) checks if the first and last digits a=
re equal.
(number/1000)%10 =3D=3D 2nd digit
(number/10)%10) =3D=3D 4th digit
if (number/1000)%10 =3D=3D (number/10)%10 checks if the second and fourth
digits are equal.
The third digit can be ignored...
Cheerio!
On Mon, 21 Jun 2004 15:45:12 -0400, dirty dragon <dir...@ms...> w=
rote:
>=20
> can someone please explain the significance of the second if statement?
> thnx pete
>=20
> if((number>=3D10000 && number <100000))
>=20
> {
> if (((number/10000) =3D=3D (number%10)) && (((number/1000)%10) =3D=3D ((n=
umber/10)
> %10)))
>=20
> cout<<number<<" is a palindrome"<<endl;
> else
> cout <<number<<" is not palindrome"<<endl;
>=20
> }
> else{
> cout<<"You did not enter a 5-digit number!"<<endl;
>=20
> _________________________________________________________________
> FREE pop-up blocking with the new MSN Toolbar =96 get it now!
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>=20
> -------------------------------------------------------
> This SF.Net email sponsored by Black Hat Briefings & Training.
> Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
> digital self defense, top technical experts, no vendor pitches,
> unmatched networking opportunities. Visit www.blackhat.com
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
--=20
Jesse Hallam
University of Waterloo Freshman
|
|
From: David M. <dml...@co...> - 2004-06-21 19:54:36
|
Ahh, that explains my original problem. when I tried to do
//Destructor for B
~B() : ~A()
{
...
}
I got an error, should have thought about it a bit more.
Lior Wehrli wrote:
>Yes, but keep in mind, that while you only have one destructor per class,
>you may have any number of constructors. So while there is no doubt as to
>which destructor will be called (there is only one), it is not clear
>beforehand which constructor will be used. By default, the compiler will use
>the "default constructor" (big surprize!), which is the one having no
>arguments. If you explicitely want to use a different constructor use the
>following syntax:
>
>class B : public A {
> public:
> B(arg1,arg2,arg3) : A(arg1,arg2+arg3) {
> // A::A(arg1,arg2+arg3) will
> // be called BEFORE this
> // constructor executes
>
> // B's specific stuff goes here
> };
>};
>
>greetings
>lior
>
>
>----- Original Message -----
>From: "David McKen" <dml...@co...>
>To: "Mailing List, Dev-Cpp" <dev...@li...>
>Sent: Monday, June 21, 2004 5:24 PM
>Subject: [Dev-C++] Derived Classes & Destructors
>
>
>
>
>>If I have a class B that inherets from a class A and I create an object
>>of type B (call it instance_B).
>>
>>when instance_B is destroyed is the destructor for class A also called?
>>
>>If so does the same thing happen for constructors?
>>
>>
>>
|
|
From: dirty d. <dir...@ms...> - 2004-06-21 19:45:19
|
can someone please explain the significance of the second if statement?
thnx pete
if((number>=10000 && number <100000))
{
if (((number/10000) == (number%10)) && (((number/1000)%10) == ((number/10)
%10)))
cout<<number<<" is a palindrome"<<endl;
else
cout <<number<<" is not palindrome"<<endl;
}
else{
cout<<"You did not enter a 5-digit number!"<<endl;
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
|
|
From: dirty d. <dir...@ms...> - 2004-06-21 19:07:43
|
hi everyone, trying to write a program which determines a 5 digit integer to be a palindrome or not. i'd like to use mudulus and division operands to separate parts of a 5 digit integer. any suggestions? i posted this on the dev-users forum yesterday but i can't get into the forums today. anyone else having trouble? thanx pete _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ |
|
From: Lior W. <we...@st...> - 2004-06-21 17:13:47
|
Yes, but keep in mind, that while you only have one destructor per class,
you may have any number of constructors. So while there is no doubt as to
which destructor will be called (there is only one), it is not clear
beforehand which constructor will be used. By default, the compiler will use
the "default constructor" (big surprize!), which is the one having no
arguments. If you explicitely want to use a different constructor use the
following syntax:
class B : public A {
public:
B(arg1,arg2,arg3) : A(arg1,arg2+arg3) {
// A::A(arg1,arg2+arg3) will
// be called BEFORE this
// constructor executes
// B's specific stuff goes here
};
};
greetings
lior
----- Original Message -----
From: "David McKen" <dml...@co...>
To: "Mailing List, Dev-Cpp" <dev...@li...>
Sent: Monday, June 21, 2004 5:24 PM
Subject: [Dev-C++] Derived Classes & Destructors
> If I have a class B that inherets from a class A and I create an object
> of type B (call it instance_B).
>
> when instance_B is destroyed is the destructor for class A also called?
>
> If so does the same thing happen for constructors?
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Jesse H. <jes...@gm...> - 2004-06-21 15:50:38
|
Yes, and yes: http://www.csse.monash.edu.au/~jonmc/CSE2305/Topics/05.09.Inheritance/html/text.html#what_happens_when_a_derivedclass_object_is_created_and_destroyed On Mon, 21 Jun 2004 11:24:27 -0400, David McKen <dml...@co...> wrote: > > If I have a class B that inherets from a class A and I create an object > of type B (call it instance_B). > > when instance_B is destroyed is the destructor for class A also called? > > If so does the same thing happen for constructors? > > ------------------------------------------------------- > This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference > Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer > Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA > REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > -- Jesse Hallam University of Waterloo Freshman |