dev-cpp-users Mailing List for Dev-C++ (Page 700)
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: <vil...@ya...> - 2001-04-25 07:14:35
|
Thank you very much, now it works. The reason it didn't work for me before is
that I was compiling an ANSI C file, not C++.
--- Jose Manuel Padron Carrillo <jos...@ya...> escribió: > I pasted
the copy and when compiling the only errors I got were due to
> the absence of these lines at the top of the file.
>
> #include <stdlib.h> //for system("PAUSE")
> #include <string.h> //for memset(...)
>
> After I added them the program compiled and run as expected.
>
> Hope this helps.
>
> Chemanuel
>
>
> --- Albert Vilella Bertran <vil...@ya...> escribió: > Does
> anybody know why the compiler doesn't recognize O_WRONLY,
> > O_RDONLY, ...
> > in function "open"?
> >
> > I get the error "12 c:\prova.c `O_WRONLY' undeclared (first use in
> > this
> > function)",
> > but I think it sould work if including unistd.h and fcntl.h, isn't
> > it?
> >
> > -----------------------------
> >
> >
> > #include <stdio.h>
> > #include <fcntl.h>
> > #include <unistd.h>
> >
> > int main(int argc, char *argv[])
> > {
> > char buffer[1024] ;
> > int fd,i,j,k ;
> >
> > memset(&buffer,'a',1024) ;
> >
> > fd = open("./prova",O_WRONLY) ;
> >
> > for (i=1; i<=2;i++)
> > {
> > printf("El valor de %d\n",i) ;
> > for (j=1; j<=5;j++)
> > write(fd,buffer,1024) ;
> > }
> > close(fd) ;
> >
> > system("PAUSE");
> > return 0;
> > }
> >
> >
> > _______________________________________________________________
> > Do You Yahoo!?
> > Envía mensajes instantáneos y recibe alertas de correo con
> > Yahoo! Messenger - http://messenger.yahoo.es
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
> _______________________________________________________________
> Do You Yahoo!?
> Envía mensajes instantáneos y recibe alertas de correo con
> Yahoo! Messenger - http://messenger.yahoo.es
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_______________________________________________________________
Do You Yahoo!?
Envía mensajes instantáneos y recibe alertas de correo con
Yahoo! Messenger - http://messenger.yahoo.es
|
|
From: Frazell T. <fr...@fl...> - 2001-04-25 02:05:21
|
Can anyone tell me where I may obtain a Visual Resource Editor for resource files (C/C++ programming languages thanks) - Frazell Thomas |
|
From: Ashokkumar A <udu...@sa...> - 2001-04-25 00:09:16
|
Dear programmers,
Please tell me why the following C++ gives error?
#include <iostream.h>
#include <stdlib.h>
#include <bitset>
int main()
{
bitset<8> bitvec;
cout<<bitvec.any();
system("PAUSE");
return 0;
}
---------------------------
The string, bitset, vector, utility, complex etc are not available in Turbo
C++ or Borland C++ or usage is different compared to Bloodshed Dev C++.Which
compiler the MS VC++ has?
ashok
|
|
From: <bis...@bt...> - 2001-04-24 17:15:26
|
Hi Is there any way to use a customize the way a makefile is generated in Dev-C++ ? Thanks in advance. Biswa. |
|
From: Purohit P. J.. <pra...@si...> - 2001-04-24 11:48:54
|
Hi,
No dear yet Dev-C++ is not available for linux,
But the author of Dev-C++ ie Colin has plans to release a linux =
version.
regards,
Prahlad Purohit
|
|
From: Peter M. <pet...@im...> - 2001-04-24 11:40:22
|
Hi all.
I have a simple question.
Is Dev C++ available for Linux yet?
Sorry if this is a common question.
Thanks In Advance.
petermead
|
|
From: <jos...@ya...> - 2001-04-24 06:45:36
|
I pasted the copy and when compiling the only errors I got were due to
the absence of these lines at the top of the file.
#include <stdlib.h> //for system("PAUSE")
#include <string.h> //for memset(...)
After I added them the program compiled and run as expected.
Hope this helps.
Chemanuel
--- Albert Vilella Bertran <vil...@ya...> escribió: > Does
anybody know why the compiler doesn't recognize O_WRONLY,
> O_RDONLY, ...
> in function "open"?
>
> I get the error "12 c:\prova.c `O_WRONLY' undeclared (first use in
> this
> function)",
> but I think it sould work if including unistd.h and fcntl.h, isn't
> it?
>
> -----------------------------
>
>
> #include <stdio.h>
> #include <fcntl.h>
> #include <unistd.h>
>
> int main(int argc, char *argv[])
> {
> char buffer[1024] ;
> int fd,i,j,k ;
>
> memset(&buffer,'a',1024) ;
>
> fd = open("./prova",O_WRONLY) ;
>
> for (i=1; i<=2;i++)
> {
> printf("El valor de %d\n",i) ;
> for (j=1; j<=5;j++)
> write(fd,buffer,1024) ;
> }
> close(fd) ;
>
> system("PAUSE");
> return 0;
> }
>
>
> _______________________________________________________________
> Do You Yahoo!?
> Envía mensajes instantáneos y recibe alertas de correo con
> Yahoo! Messenger - http://messenger.yahoo.es
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_______________________________________________________________
Do You Yahoo!?
Envía mensajes instantáneos y recibe alertas de correo con
Yahoo! Messenger - http://messenger.yahoo.es
|
|
From: <vil...@ya...> - 2001-04-23 10:15:14
|
Does anybody know why the compiler doesn't recognize O_WRONLY, O_RDONLY, ...
in function "open"?
I get the error "12 c:\prova.c `O_WRONLY' undeclared (first use in this
function)",
but I think it sould work if including unistd.h and fcntl.h, isn't it?
-----------------------------
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
char buffer[1024] ;
int fd,i,j,k ;
memset(&buffer,'a',1024) ;
fd = open("./prova",O_WRONLY) ;
for (i=1; i<=2;i++)
{
printf("El valor de %d\n",i) ;
for (j=1; j<=5;j++)
write(fd,buffer,1024) ;
}
close(fd) ;
system("PAUSE");
return 0;
}
_______________________________________________________________
Do You Yahoo!?
Envía mensajes instantáneos y recibe alertas de correo con
Yahoo! Messenger - http://messenger.yahoo.es
|
|
From: Ashokkumar A <udu...@sa...> - 2001-04-23 00:19:37
|
Dear programmers,
Please tell me why the following C++ gives error?
#include <iostream.h>
#include <stdlib.h>
#include <bitset>
int main()
{
bitset<8> bitvec;
cout<<bitvec.any();
system("PAUSE");
return 0;
}
---------------------------
The string, bitset, vector, utility, complex etc are not available in Turbo
C++ or Borland C++ or usage is different compared to Bloodshed Dev C++.Which
compiler the MS VC++ has?
ashok
|
|
From: Bolek V. <vr...@pa...> - 2001-04-22 17:55:58
|
Ioannis Vranos wrote:
>
> Thanks a lot. That was what i had guessed... but had not seen it written
> explicitly at any book (that class member functions of an object can access
> private members of another instance of the same class).
>
I have not seen it written explicitly too. But I haven't seen explicitly
written they cannot do it so I suppose they can.
--
============================================================
Ing. Boleslav Vrany
Stanice techniku DDM hl. m. Prahy
Pod Juliskou 2a
Praha 6 - Dejvice
16000
Czech Republic
tel. (420 2) 243 10 240
|
|
From: Colin L. <web...@bl...> - 2001-04-22 14:20:35
|
Hi !
> I've been trying to use Dev-C++ with the latest MingW snapshot but have been
> running into problems. The error comes from the pre-processor; namely:
>
> cpp: unrecognized option `-remap'
>
> Doing some tests, this only occurs when the variable GCC_EXEC_PREFIX is set.
> I undet the variable and ran make from the command line, and everything went
> fine. However, when I run it from Dev-C++, the same error occurs again,
> which has led me to believe that Dev-C++ automatically sets the variable.
> Since this si not a registry entry, I'm inclined to think that this is
> hard-coded into the executable. Can the Dev-C++ developers shed some light
> into this, or suggest a workaround ?
No GCC_EXEC_PREFIX variable is set in version 4. Only version 3 has that hard
coded setting. You may inspect your compile log sheet after trying to compile
under Dev-C++
Greetings,
Colin
> Regards.
> Biswa.
--
Colin Laplace
web...@bl...
http://www.bloodshed.net
|
|
From: Ioannis V. <no...@ya...> - 2001-04-22 12:37:11
|
#include <stdlib.h>
system("cls");
Ioannis
* Ioannis Vranos
* Programming pages: http://members.nbci.com/noicys
* Alternative URL: http://run.to/noicys
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of teleparla
Sent: Sunday, April 22, 2001 1:39 AM
To: dev...@li...
Subject: [Dev-C++] help
Alguien me podria decir que funci=F3n se puede utilizar para limpiar la
pantalla, y dentro de que librer=EDa se encuentra.
I try with clrscr() but the compiler d'ont reconice this function.
I d'ont found the function for clear the screnn, someone can help me?
muchas gracias
|
|
From: Vassili <v.v...@bt...> - 2001-04-22 10:50:22
|
Try this, Click project tab, project options, load object file, go to the the = Dev-C++ lib folder, and select the conio object file. Hope this helps. Vas ----- Original Message -----=20 From: teleparla=20 To: dev...@li...=20 Sent: Sunday, April 22, 2001 12:38 AM Subject: [Dev-C++] help Alguien me podria decir que funci=F3n se puede utilizar para limpiar = la pantalla, y dentro de que librer=EDa se encuentra. I try with clrscr() but the compiler d'ont reconice this function. I d'ont found the function for clear the screnn, someone can help me? = muchas gracias=20 |
|
From: teleparla <tel...@te...> - 2001-04-21 23:37:10
|
Alguien me podria decir que funci=F3n se puede utilizar para limpiar la = pantalla, y dentro de que librer=EDa se encuentra. I try with clrscr() but the compiler d'ont reconice this function. I d'ont found the function for clear the screnn, someone can help me? = muchas gracias=20 |
|
From: Ioannis V. <no...@ya...> - 2001-04-21 21:31:06
|
Thanks a lot. That was what i had guessed... but had not seen it written explicitly at any book (that class member functions of an object can access private members of another instance of the same class). Ioannis * Ioannis Vranos * Programming pages: http://members.nbci.com/noicys * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of Bolek Vrany > Sent: Saturday, April 21, 2001 10:22 PM > To: dev...@li... > Subject: Re: [Dev-C++] C++ Question (the real one) > > > > Ioannis Vranos wrote: > > > > Ok i was stupid for my previous question. The answer is because it was > > a friend function. Here is the real question: > > > > #include <iostream> > > > > class Matrix > > { > > double m[4][4]; > > > > public: > > void test(Matrix s); > > }; > > > > > > void Matrix::test(Matrix s) > > { > > for (int i=0; i<4; i++) > > { > > std::cout<<std::endl; > > > > for(int j=0; j<4; j++) > > std:: cout<<s.m[i][j]<<std::endl; > > } > > } > > > > int main() > > { > > > > return 0; > > } > > > > The member function test() accesses the private data member of its > > argument directly. When is it allowed for functions to access directly > > the private members of their arguments except of those declared > > as friends? > > It is allowed for friends and member functions of the same class (class > A) only - but it is allowed regeradless of whether it accesses data > members of its own instance (*this) or another instance of the class. > You can also declare a whole class B as a friend. This will cause all > member functions of class B to be friends of class A. > > -- > ============================================================ > Ing. Boleslav Vrany > Stanice techniku DDM hl. m. Prahy > Pod Juliskou 2a > Praha 6 - Dejvice > 16000 > Czech Republic > > tel. (420 2) 243 10 240 > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Bolek V. <vr...@pa...> - 2001-04-21 20:21:00
|
> Ioannis Vranos wrote:
>
> Ok i was stupid for my previous question. The answer is because it was
> a friend function. Here is the real question:
>
> #include <iostream>
>
> class Matrix
> {
> double m[4][4];
>
> public:
> void test(Matrix s);
> };
>
>
> void Matrix::test(Matrix s)
> {
> for (int i=0; i<4; i++)
> {
> std::cout<<std::endl;
>
> for(int j=0; j<4; j++)
> std:: cout<<s.m[i][j]<<std::endl;
> }
> }
>
> int main()
> {
>
> return 0;
> }
>
> The member function test() accesses the private data member of its
> argument directly. When is it allowed for functions to access directly
> the private members of their arguments except of those declared
> as friends?
It is allowed for friends and member functions of the same class (class
A) only - but it is allowed regeradless of whether it accesses data
members of its own instance (*this) or another instance of the class.
You can also declare a whole class B as a friend. This will cause all
member functions of class B to be friends of class A.
--
============================================================
Ing. Boleslav Vrany
Stanice techniku DDM hl. m. Prahy
Pod Juliskou 2a
Praha 6 - Dejvice
16000
Czech Republic
tel. (420 2) 243 10 240
|
|
From: Fabien V. <fv...@ne...> - 2001-04-21 20:19:33
|
Hi.
Palindrom numbers are numbers which you can "read" from the begining or the
end.
11
151
1551
15251
152251
and so on....
----- Original Message -----
From: "Bolek Vrany" <vr...@pa...>
To: <dev...@li...>
Sent: Saturday, April 21, 2001 2:50 PM
Subject: Re: [Dev-C++] Number backwards?
> Hi,
>
> what palindrom numbers are?
>
> > Hello,
> > To use a number backward first you need to separare the digits of
> > the no.
> >
> > To do this say you have nNo=5234
> > To separate thousands digit ie 5 thousnad_digit = nNo/1000;
> > To get the hundred digit ie 2 hunreds_digit =
> > (nNo%1000)/100;
> > ( In above nNo%1000 will give 234 and then 234/100 will
> > give 2 )
> > To get tens digit ie 3 tens_digit =
> > (nNo%100)/10;
> > ( In above nNo%100 will give 34 and then 34/10 will give 3 )
> > To get the units digit ie 4 unit_digit = (nNo%10);
> > ( In Above nNo%10 Will give 4 )
> >
> > % is Called MODULUS OPERATOR and it give remainder of
> > a division.
> >
> > Now you have separated all the digits of original no now to revert
> > the no. simply change the units digit to thousands digit,
> > tens digit to hundreds digit, hundreds digit to tens digit, thousands
> > digit to unit digit. The nos get reversed.
> >
> > RevNo = unit_digit*1000 + tens_digit*100 + hundreds_digit*10 +
> > thousand_digit ;
> >
> > ( This above expression is equal to RevNo = 4*1000 + 3*100
> > + 2*10 + 5 ; therefore RevNo=4325 )
>
> Sorry for talking about my function again. I am not sure what Jesper
> Ekberg needs to do - if he needs to convert 00012345 to 54321000 then
> the above is probably the best algorithm - provided you know the maximum
> number of digits. However, if he needs to convert 00012345 to just
> 54321, then he needs to find the number of digits first. That's why it
> is better to do it this way:
>
> unsigned backwards( unsigned n)
> // Reverse order of digits (in decadic)
> {
> unsigned result = 0;
>
> while (n > 0) {
> result = 10*result + n % 10;
> n = n / 10;
> }
> return result;
> }
>
> Sorry for not explaining it in previous mails. result is simply the
> result. 10*result shifts the result one digit left. n % 10 is the last
> digit of n and n = n/10 shifts n one digit right. So assuming n=12345 at
> the beginning it does the following:
> result=0, n=12345
> first iteration:
> result = 10*0 + 5 // == 5
> n = 1234;
> second it.:
> result = 10*5 + 4; // == 54
> n = 123;
> third it.:
> result = 10*54 + 3; // == 543
> n = 12;
> etc.
>
> This way he needs not know the number of digits.
>
> !!! WARNING: (I should have realized it immediately) There is a problem
> you will always have - all algorithms will lead to integer overflow in
> some cases. Assume max. unsigned is 65535 and you want to convert 12347.
> The correct result is 74321, which outside the range of unsigned. The
> correct version of my function is
>
> #include <stdexcept>
> #include <limits>
>
> unsigned backwards( unsigned n)
> // Reverse order of digits (in decadic)
> {
> unsigned result = 0, max = numeric_limits<unsigned>.max;
>
> while (n > 0) {
> if ((result > max / 10) ||
> // avoid overflow in multiplying 10*result
> (n % 10 > max - 10*result))
> // avoid overflow in adding n % 10
> throw overflow_error( "Overflow in function backwards");
> result = 10*result + n % 10;
> n = n / 10;
> }
> return result;
> }
>
> Or you must either restrict the range of n or the type of result must be
> at least one digit wider than the type of n. Might be double result and
> unsigned (long) n.
> --
> ============================================================
> Ing. Boleslav Vrany
> Stanice techniku DDM hl. m. Prahy
> Pod Juliskou 2a
> Praha 6 - Dejvice
> 16000
> Czech Republic
>
> tel. (420 2) 243 10 240
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Ioannis V. <no...@ya...> - 2001-04-21 20:01:37
|
Ok i was stupid for my previous question. The answer is because it was a
friend function. Here is the real question:
#include <iostream>
class Matrix
{
double m[4][4];
public:
void test(Matrix s);
};
void Matrix::test(Matrix s)
{
for (int i=0; i<4; i++)
{
std::cout<<std::endl;
for(int j=0; j<4; j++)
std:: cout<<s.m[i][j]<<std::endl;
}
}
int main()
{
return 0;
}
The member function test() accesses the private data member of its argument
directly. When is it allowed for functions to access directly the private
members of their arguments except of those declared as friends?
Thanks in advance,
Ioannis
* Ioannis Vranos
* Programming pages: http://members.nbci.com/noicys
* Alternative URL: http://run.to/noicys
|
|
From: Ioannis V. <no...@ya...> - 2001-04-21 19:48:10
|
Guys & girls i need your help. :)
We have the following C++ code:
#include <iostream>
class Matrix
{
double m[4][4];
public:
friend Matrix operator+(const Matrix &, const Matrix &);
};
Matrix operator+(const Matrix &arg1, const Matrix &arg2)
{
Matrix sum;
for(int i=0; i<4; i++)
{
for(int j=0; j<4; j++)
sum.m[i][j]=arg1.m[i][j] + arg2.m[i][j];
}
return sum;
}
int main()
{
return 0;
}
It compiles ok. In the definition of operator+ we have the access of private
data members using the . notion directly. The code was taken from
Stroustrup's special edition. In that book i have seen the same access style
of private data members in all member functions of a class. What is the rule
here? Under what circumstances can we access directly private members of a
class?
I hope someone will help to figure it out.
Thanks in advance,
Ioannis
* Ioannis Vranos
* Programming pages: http://members.nbci.com/noicys
* Alternative URL: http://run.to/noicys
|
|
From: Bolek V. <vr...@pa...> - 2001-04-21 17:19:09
|
Hi,
what palindrom numbers are?
> Hello,
> To use a number backward first you need to separare the digits of
> the no.
>
> To do this say you have nNo=5234
> To separate thousands digit ie 5 thousnad_digit = nNo/1000;
> To get the hundred digit ie 2 hunreds_digit =
> (nNo%1000)/100;
> ( In above nNo%1000 will give 234 and then 234/100 will
> give 2 )
> To get tens digit ie 3 tens_digit =
> (nNo%100)/10;
> ( In above nNo%100 will give 34 and then 34/10 will give 3 )
> To get the units digit ie 4 unit_digit = (nNo%10);
> ( In Above nNo%10 Will give 4 )
>
> % is Called MODULUS OPERATOR and it give remainder of
> a division.
>
> Now you have separated all the digits of original no now to revert
> the no. simply change the units digit to thousands digit,
> tens digit to hundreds digit, hundreds digit to tens digit, thousands
> digit to unit digit. The nos get reversed.
>
> RevNo = unit_digit*1000 + tens_digit*100 + hundreds_digit*10 +
> thousand_digit ;
>
> ( This above expression is equal to RevNo = 4*1000 + 3*100
> + 2*10 + 5 ; therefore RevNo=4325 )
Sorry for talking about my function again. I am not sure what Jesper
Ekberg needs to do - if he needs to convert 00012345 to 54321000 then
the above is probably the best algorithm - provided you know the maximum
number of digits. However, if he needs to convert 00012345 to just
54321, then he needs to find the number of digits first. That's why it
is better to do it this way:
unsigned backwards( unsigned n)
// Reverse order of digits (in decadic)
{
unsigned result = 0;
while (n > 0) {
result = 10*result + n % 10;
n = n / 10;
}
return result;
}
Sorry for not explaining it in previous mails. result is simply the
result. 10*result shifts the result one digit left. n % 10 is the last
digit of n and n = n/10 shifts n one digit right. So assuming n=12345 at
the beginning it does the following:
result=0, n=12345
first iteration:
result = 10*0 + 5 // == 5
n = 1234;
second it.:
result = 10*5 + 4; // == 54
n = 123;
third it.:
result = 10*54 + 3; // == 543
n = 12;
etc.
This way he needs not know the number of digits.
!!! WARNING: (I should have realized it immediately) There is a problem
you will always have - all algorithms will lead to integer overflow in
some cases. Assume max. unsigned is 65535 and you want to convert 12347.
The correct result is 74321, which outside the range of unsigned. The
correct version of my function is
#include <stdexcept>
#include <limits>
unsigned backwards( unsigned n)
// Reverse order of digits (in decadic)
{
unsigned result = 0, max = numeric_limits<unsigned>.max;
while (n > 0) {
if ((result > max / 10) ||
// avoid overflow in multiplying 10*result
(n % 10 > max - 10*result))
// avoid overflow in adding n % 10
throw overflow_error( "Overflow in function backwards");
result = 10*result + n % 10;
n = n / 10;
}
return result;
}
Or you must either restrict the range of n or the type of result must be
at least one digit wider than the type of n. Might be double result and
unsigned (long) n.
--
============================================================
Ing. Boleslav Vrany
Stanice techniku DDM hl. m. Prahy
Pod Juliskou 2a
Praha 6 - Dejvice
16000
Czech Republic
tel. (420 2) 243 10 240
|
|
From: Scone S. <sc...@ho...> - 2001-04-21 10:29:53
|
Hi, I'm trying to make mp3-player. Does anyone know where i can find mp3.lib or similar? And does anyone have working example i can take a look at? Thx, Sconed _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. |
|
From: Colin L. <web...@bl...> - 2001-04-20 20:54:11
|
Hi, This is because the history remembers which files you opened, and you probab= ly opened a few ones directly from your floppy drive=2E You can remedy to this problem by clicking on the File menu, then Reopen, and finally click "Clear history" Greetings, Colin On Fri, 20 Apr 2001, you wrote: > Hi, > I don't know if anybody else has experienced this problem, but after some > time using DevC++ 4=2E01, when I click to "&File" to access the file optio= ns, > I have to wait for some seconds until the menu is displayed=2E=20 > When I write this, I have timed 25 seconds !!!=2E >=20 > Does anybody know anything about this problem? >=20 > thanks >=20 >=20 > _______________________________________________________________ > Do You Yahoo!? > Env=EDa mensajes instant=E1neos y recibe alertas de correo con=20 > Yahoo! Messenger - http://messenger=2Eyahoo=2Ees >=20 > _______________________________________________ > Dev-cpp-users mailing list > Dev-cpp-users@lists=2Esourceforge=2Enet > http://lists=2Esourceforge=2Enet/lists/listinfo/dev-cpp-users --=20 Colin Laplace webmaster@bloodshed=2Enet http://www=2Ebloodshed=2Enet |
|
From: Purohit P. J.. <pra...@si...> - 2001-04-20 18:59:05
|
Hi,
Your compiler is giving you error since your function result is =
supposed to accept first argument a pointer to character and you are =
trying to pass character to it. Send the source code so that we can =
help much better.
=20
I don't think compiler messages require any explainations there are =
just a few common error messages and soon you will get used to them
=20
BYE,
Prahlad
----- Original Message -----=20
From: Ruth Aviton=20
To: dev...@li...=20
Sent: Friday, April 20, 2001 9:31 PM
Subject: [Dev-C++] compileresults
hi everybody,
I am just a beginner in programming and I have two questions:=20
1. When I compile a small, simple program i get a compile =
message as follows. I have no idea what it means and have no idea where =
to start looking! passing `char' to argument 1 of `result(char *, =
int)' lacks a cast This happens when i try to call a function.
2. Is there any place where i can get a explanation on what the =
compiler results mean ?=20
Thank you!
Ruth
=20
=20
=20
_________________________________________________
IncrediMail - Email has finally evolved - Click Here=20
|
|
From: <vil...@ya...> - 2001-04-20 16:59:28
|
Ok, Thanks, and there is also something that seems strange: When I execute Dev-C++ 4.01, it always searches for the floppy disks, and when I open the menu of "open file" it also searches for floppy disks. I don't know if there is something I could do to eliminate this behaviour. _______________________________________________________________ Do You Yahoo!? Envía mensajes instantáneos y recibe alertas de correo con Yahoo! Messenger - http://messenger.yahoo.es |
|
From: <bis...@bt...> - 2001-04-20 15:59:48
|
Hi all I've created a new template and saved it in the C:\Dev-C++\ directory but I can't see it in the project list. Is it supposed to go to a different place or am I doing something else wrong ? Thanks in advance. - Biswa. |