dev-cpp-users Mailing List for Dev-C++ (Page 242)
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: P.D. v. Z. <pd...@xs...> - 2004-03-09 11:39:24
|
Is it by any chance possible to retrieve the directory where the binary is stored as well? I've managed to do this using the Win32 API, by getting the filename of the running module, and stripping the module name off, but I'd like to be able to do the same under Linux (I kind of need it, since my application needs to load some files that are in the same directory as the binary, and if the current working directory is not the directory the binary's stored in, it won't find those files, and my application will scream bloody murder) :) Sorry for jumping onto somebody else's question btw. Regards, Paul -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Per Westermark Sent: Tuesday, March 09, 2004 10:28 AM To: Kevin Wood Cc: DEV-C++ Subject: Re: [Dev-C++] How to get application directory? The question was which directory the application is running in - not where the application binary is stored. /Per W On Tue, 9 Mar 2004, Kevin Wood wrote: > getcwd() returns the current working directory, which is not necessarily > the same as the directory in which the application resides. > > At 08:10 09/03/04, Per Westermark wrote: > >getcwd() or _getcwd(). > > > >/Per W > > > >On Tue, 9 Mar 2004, Josep Subirana wrote: > > > > > Hi, > > > > > > Do you know how to get the directory where your c++ application is running > > > in? > > > This should be a simple question for most experienced c++ programmers! > > > > > > Thanks, > > > > > > Josep > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > 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 > ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ 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: Daniel G. <sp...@ho...> - 2004-03-09 11:35:27
|
That sounds about right :) >From: Oladipo Odumosu <gen...@ya...> >To: Daniel Glenfield <sp...@ho...> >Subject: Re: [Dev-C++] protected and private in c++ classes >Date: Tue, 9 Mar 2004 11:06:28 +0000 (GMT) > >private members cannot be accessed except by member methods/functions of >the class they belong to. they also cannot be inherited. protected members >are almost exactly like private, but they can be inherited. inheriting a >protected member are private makes it private in the derived class. >inheriting a protected member as public leaves it as protected. > >plz lemme know if i'm wrong, too > > >--------------------------------- >Too much spam in your inbox? Yahoo! Mail gives you the best spam protection >for FREE! Get Yahoo!Mail _________________________________________________________________ Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo |
|
From: Daniel G. <sp...@ho...> - 2004-03-09 11:24:20
|
As I understand it, when a class is derived PUBLICALLY from another class,
it inherits the parent's public members as public.
So
class Person
{
public:
String* HairColour;
}
class EmployeeID : public Person
{
// We implicitly have a public member String* HairColour. If the code
was written
// instead of being hidden it would read
// public:
// String* HairColour;
}
If EmpoyeeID was derived as protected, we would have
// private:
// String* HairColour
By public to that class, I mean an object of the class can access the member
by doing MyObj.PublicMember = 25; or whatever.
>From: Siva Chandra <siv...@ya...>
>To: Daniel Glenfield <sp...@ho...>
>CC: Dev...@li...
>Subject: Re: [Dev-C++] protected and private in c++ classes
>Date: Tue, 9 Mar 2004 02:57:43 -0800 (PST)
>
>hi Daniel,
>
>I agree on your explaination for private but I am kind
>of confused with your explaination on protected. what
>do you mean by "//class employee now has private:
>..."?
>
>...and what do you mean by "...public to that class"?
>
>Siva Chandra
>
>--- Daniel Glenfield <sp...@ho...> wrote:
> > I don't think that is quite correct.
> >
> > Without getting too nerdy, private specifies that
> > the member variable or
> > method (methods are usually public, not private) can
> > only be accessed by a
> > method of that class, and cannot be accessed
> > directly.
> > So if I have a private member
> > int EmployeeID;
> > I cannot do
> >
> > MyObject.EmployeeID = 12345;
> > Because it is private. What I need is a public
> > method like this
> >
> > void SetEmployeeID(int Num)
> > {
> > EmployeeID = Num;
> > }
> > Then I can do MyObject.SetEmployeeID(12345);
> >
> >
> > Protected means the members are public to that
> > class, but if a class is
> > derived from it then they become private. e.g.
> >
> > class Person
> > {
> > protected:
> > double DNASequence;
> > }
> >
> > class Employee : public Person
> > {
> > // class Employee now has
> > // private :
> > // double DNASequence;
> >
> > }
> >
> > Let me know if any of this sounds wrong.
> >
> > Daniel
> >
> >
> > >From: Per Westermark <pw...@ia...>
> > >To: studioartoni <stu...@li...>
> > >CC: Dev...@li...
> > >Subject: Re: [Dev-C++] protected and private in c++
> > classes
> > >Date: Tue, 9 Mar 2004 11:15:18 +0100 (CET)
> > >
> > >Private is only for methods of the class.
> > >
> > >Protected are also available to all inherriting
> > classes.
> > >
> > >/Per W
> > >
> > >On Tue, 9 Mar 2004, studioartoni wrote:
> > >
> > > > Excuse the question,
> > > > but which is the difference between 'protected'
> > and 'private' in c++
> > >classes?
> > > > Thank you.
> > > >
> > > >
> > >
> > >
> > >
> >
> >-------------------------------------------------------
> > >This SF.Net email is sponsored by: IBM Linux
> > Tutorials
> > >Free Linux tutorial presented by Daniel Robbins,
> > President and CEO of
> > >GenToo technologies. Learn everything from
> > fundamentals to system
> >
> >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > >_______________________________________________
> > >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
> >
> >
>_________________________________________________________________
> > Find a cheaper internet access deal - choose one to
> > suit you.
> > http://www.msn.co.uk/internetaccess
> >
> >
> >
> >
>-------------------------------------------------------
> > This SF.Net email is sponsored by: IBM Linux
> > Tutorials
> > Free Linux tutorial presented by Daniel Robbins,
> > President and CEO of
> > GenToo technologies. Learn everything from
> > fundamentals to system
> >
>administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> > _______________________________________________
> > 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
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Search - Find what youre looking for faster
>http://search.yahoo.com
_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger
http://www.msn.co.uk/messenger
|
|
From: Siva C. <siv...@ya...> - 2004-03-09 11:14:45
|
hi Daniel,
I agree on your explaination for private but I am kind
of confused with your explaination on protected. what
do you mean by "//class employee now has private:
..."?
...and what do you mean by "...public to that class"?
Siva Chandra
--- Daniel Glenfield <sp...@ho...> wrote:
> I don't think that is quite correct.
>
> Without getting too nerdy, private specifies that
> the member variable or
> method (methods are usually public, not private) can
> only be accessed by a
> method of that class, and cannot be accessed
> directly.
> So if I have a private member
> int EmployeeID;
> I cannot do
>
> MyObject.EmployeeID = 12345;
> Because it is private. What I need is a public
> method like this
>
> void SetEmployeeID(int Num)
> {
> EmployeeID = Num;
> }
> Then I can do MyObject.SetEmployeeID(12345);
>
>
> Protected means the members are public to that
> class, but if a class is
> derived from it then they become private. e.g.
>
> class Person
> {
> protected:
> double DNASequence;
> }
>
> class Employee : public Person
> {
> // class Employee now has
> // private :
> // double DNASequence;
>
> }
>
> Let me know if any of this sounds wrong.
>
> Daniel
>
>
> >From: Per Westermark <pw...@ia...>
> >To: studioartoni <stu...@li...>
> >CC: Dev...@li...
> >Subject: Re: [Dev-C++] protected and private in c++
> classes
> >Date: Tue, 9 Mar 2004 11:15:18 +0100 (CET)
> >
> >Private is only for methods of the class.
> >
> >Protected are also available to all inherriting
> classes.
> >
> >/Per W
> >
> >On Tue, 9 Mar 2004, studioartoni wrote:
> >
> > > Excuse the question,
> > > but which is the difference between 'protected'
> and 'private' in c++
> >classes?
> > > Thank you.
> > >
> > >
> >
> >
> >
>
>-------------------------------------------------------
> >This SF.Net email is sponsored by: IBM Linux
> Tutorials
> >Free Linux tutorial presented by Daniel Robbins,
> President and CEO of
> >GenToo technologies. Learn everything from
> fundamentals to system
>
>administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> >_______________________________________________
> >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
>
>
_________________________________________________________________
> Find a cheaper internet access deal - choose one to
> suit you.
> http://www.msn.co.uk/internetaccess
>
>
>
>
-------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux
> Tutorials
> Free Linux tutorial presented by Daniel Robbins,
> President and CEO of
> GenToo technologies. Learn everything from
> fundamentals to system
>
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> 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
__________________________________
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster
http://search.yahoo.com
|
|
From: Daniel G. <sp...@ho...> - 2004-03-09 11:03:22
|
I don't think that is quite correct.
Without getting too nerdy, private specifies that the member variable or
method (methods are usually public, not private) can only be accessed by a
method of that class, and cannot be accessed directly.
So if I have a private member
int EmployeeID;
I cannot do
MyObject.EmployeeID = 12345;
Because it is private. What I need is a public method like this
void SetEmployeeID(int Num)
{
EmployeeID = Num;
}
Then I can do MyObject.SetEmployeeID(12345);
Protected means the members are public to that class, but if a class is
derived from it then they become private. e.g.
class Person
{
protected:
double DNASequence;
}
class Employee : public Person
{
// class Employee now has
// private :
// double DNASequence;
}
Let me know if any of this sounds wrong.
Daniel
>From: Per Westermark <pw...@ia...>
>To: studioartoni <stu...@li...>
>CC: Dev...@li...
>Subject: Re: [Dev-C++] protected and private in c++ classes
>Date: Tue, 9 Mar 2004 11:15:18 +0100 (CET)
>
>Private is only for methods of the class.
>
>Protected are also available to all inherriting classes.
>
>/Per W
>
>On Tue, 9 Mar 2004, studioartoni wrote:
>
> > Excuse the question,
> > but which is the difference between 'protected' and 'private' in c++
>classes?
> > Thank you.
> >
> >
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by: IBM Linux Tutorials
>Free Linux tutorial presented by Daniel Robbins, President and CEO of
>GenToo technologies. Learn everything from fundamentals to system
>administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
>_______________________________________________
>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
_________________________________________________________________
Find a cheaper internet access deal - choose one to suit you.
http://www.msn.co.uk/internetaccess
|
|
From: Neszt T. <ne...@ss...> - 2004-03-09 10:55:35
|
Hello! Congratulations for the Devpaks.org, it is perfect! I till use devc4, and I would like to use allegro. I tried the allegro devpaks with devc++5 and everything was ok. I was able to compile statically my project. But, when I try to use it under devc4, with the same settings, libraries, headers, I got a cuple of error messages. I suppose, that is because the old mingw compiler. Anyway I played a little time to upgrade the compiler under the devc4, but I realised it is hard to me. :) My question is, if there are allegro devpaks for devc4, or anybody know the way how to use the current devpak under devc4? Regards, Neszt Tibor |
|
From: michele <mic...@li...> - 2004-03-09 10:39:07
|
=20 I have a problem with Irrlicht. I downloaded sdk-0.5 but not all the = examples run good. (The good thing is that the sdk contains files for dev-c++!!). =20 The console says.... "DirectX Driver was not compiled into this dll. Try = OpenGL". =20 ...but even when opengl works there is some problem... Could it concerns = with my dll or with my graphic-card-driver? (Sometimes it causes bad = loop.console: "OpenGL device only has one texture unit. Disable = multitexturing."). =20 (Moreover I downloaded new directX dll but the problem remains.) =20 Thanks for any help. =20 If you are searching for a good glut tutorial, try this: http://www.lighthouse3d.com/opengl/glut/ =20 Michele |
|
From: Per W. <pw...@ia...> - 2004-03-09 10:32:27
|
Private is only for methods of the class. Protected are also available to all inherriting classes. /Per W On Tue, 9 Mar 2004, studioartoni wrote: > Excuse the question, > but which is the difference between 'protected' and 'private' in c++ classes? > Thank you. > > |
|
From: michele <mic...@li...> - 2004-03-09 10:29:39
|
...I encounter the same problem (on Windows 2000). ----- Original Message ----- From: "Rodrigo Ferreira Bagni" <rb...@bo...> To: "dev-cpp-users" <mailto:dev...@li...> Sent: Sunday, March 07, 2004 12:15 AM Subject: [Dev-C++] Debug Dev-4.9.8.0 I am using Dev-C++ 4.9.8.0 and Windows 98. In spite of I have checked the item "Generate debugging information" I still can't debug. Is there anything else I can do? Thanks. _________________________________________________________________________= _ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - =C9 gr=E1tis! http://antipopup.uol.com.br/ ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=3Dick _______________________________________________ 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: studioartoni <stu...@li...> - 2004-03-09 10:28:29
|
Excuse the question,=20 but which is the difference between 'protected' and 'private' in c++ = classes? Thank you. |
|
From: Per W. <pw...@ia...> - 2004-03-09 09:45:28
|
The question was which directory the application is running in - not where the application binary is stored. /Per W On Tue, 9 Mar 2004, Kevin Wood wrote: > getcwd() returns the current working directory, which is not necessarily > the same as the directory in which the application resides. > > At 08:10 09/03/04, Per Westermark wrote: > >getcwd() or _getcwd(). > > > >/Per W > > > >On Tue, 9 Mar 2004, Josep Subirana wrote: > > > > > Hi, > > > > > > Do you know how to get the directory where your c++ application is running > > > in? > > > This should be a simple question for most experienced c++ programmers! > > > > > > Thanks, > > > > > > Josep > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > 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: Kevin W. <ke...@me...> - 2004-03-09 09:41:38
|
getcwd() returns the current working directory, which is not necessarily the same as the directory in which the application resides. At 08:10 09/03/04, Per Westermark wrote: >getcwd() or _getcwd(). > >/Per W > >On Tue, 9 Mar 2004, Josep Subirana wrote: > > > Hi, > > > > Do you know how to get the directory where your c++ application is running > > in? > > This should be a simple question for most experienced c++ programmers! > > > > Thanks, > > > > Josep > > |
|
From: Per W. <pw...@ia...> - 2004-03-09 08:45:27
|
The confirmation reply should be sent to "dev-cpp-users-request" address not to the "dev-cpp-users" address - we people already on the list can't help you with any confirmations ... /Per W On Tue, 9 Mar 2004, skrishnamachari wrote: > confirm 290175 > On Tue, 2004-03-09 at 13:19, dev...@li... > wrote: > > Dev-cpp-users -- confirmation of subscription -- request 290175 > > > > We have received a request from 10.3.1.7 for subscription of your > > email address, <skr...@ho...>, to the > > dev...@li... mailing list. To confirm the > > request, please send a message to > > dev...@li..., and either: > > > > - maintain the subject line as is (the reply's additional "Re:" is > > ok), > > > > - or include the following line - and only the following line - in the > > message body: > > > > confirm 290175 > > > > (Simply sending a 'reply' to this message should work from most email > > interfaces, since that usually leaves the subject line in the right > > form.) > > > > If you do not wish to subscribe to this list, please simply disregard > > this message. Send questions to > > dev...@li.... > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > 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: skrishnamachari <skr...@ho...> - 2004-03-09 08:38:12
|
confirm 290175 On Tue, 2004-03-09 at 13:19, dev...@li... wrote: > Dev-cpp-users -- confirmation of subscription -- request 290175 > > We have received a request from 10.3.1.7 for subscription of your > email address, <skr...@ho...>, to the > dev...@li... mailing list. To confirm the > request, please send a message to > dev...@li..., and either: > > - maintain the subject line as is (the reply's additional "Re:" is > ok), > > - or include the following line - and only the following line - in the > message body: > > confirm 290175 > > (Simply sending a 'reply' to this message should work from most email > interfaces, since that usually leaves the subject line in the right > form.) > > If you do not wish to subscribe to this list, please simply disregard > this message. Send questions to > dev...@li.... |
|
From: Per W. <pw...@ia...> - 2004-03-09 08:27:08
|
getcwd() or _getcwd(). /Per W On Tue, 9 Mar 2004, Josep Subirana wrote: > Hi, > > Do you know how to get the directory where your c++ application is running > in? > This should be a simple question for most experienced c++ programmers! > > Thanks, > > Josep > > P.S. I have been able to run EMBEDDED MYSQL with Dev-C++ successfully. Now > it links > the libmysqld.a library + the programm successfully uses embedded mysql... > If anyone > is interested in running embedded mysql too, please let me know! > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > 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: Josep S. <sub...@ar...> - 2004-03-09 08:19:36
|
Hi, Do you know how to get the directory where your c++ application is running in? This should be a simple question for most experienced c++ programmers! Thanks, Josep P.S. I have been able to run EMBEDDED MYSQL with Dev-C++ successfully. Now it links the libmysqld.a library + the programm successfully uses embedded mysql... If anyone is interested in running embedded mysql too, please let me know! |
|
From: Josep S. <sub...@ar...> - 2004-03-08 17:44:26
|
>>The compiler(linker) complains that >>it can't fund function xxxx@xx (e.g. I use mysql_close(), compilation ends in error like "can't find >>function mysql_close@4") IT WORKS NOW!! Yes, the problem was that the programmes "pexports" (see email from Muxas) or "impdef" generate a def file where the functions of the DLL are NOT defined in the STDCALL way (i.e. with @number after the function). Lukily, the VisualC++ version comes with a .exp file which is the equivalent for the .def file that we need in order to genarate libmysqld.a for the Dev-C++. So with a bit of copy and paste, I took the function definitions (with @number at the end) from the .exp file and manually generated a .def file that looks like this: LIBRARY LIBMYSQLD DESCRIPTION 'MySQL 4.0 Embedded Server Library' VERSION 4.0 EXPORTS myodbc_remove_escape@8 mysql_affected_rows@4 mysql_change_user@16 mysql_character_set_name@4 mysql_close@4 mysql_connect@16 ... After you have this STDCALL compliant .def file you have only to run the dlltool utility (to be found in the bin folder of mingw) with the same parameters that Muxas described (I also used the --dllname flag [see below...] and don't forget the --kill-at flag!): dlltool --input-def libmysqld.def --dllname libmysqld.dll --output-lib libmysqld.a --kill-at The generated libmysqld.a COMPILES WITH Dev-C++ without problem! I've put both the original VisualC++ project and the Dev-C++ (including the working libmysqld.a) files for DOWNLOAD on my website, http://www.subirana.de/mysql.zip so you can try if you want. Just one warning: Although now Dev-C++ compiles and links without problems thanks to the new library libmysqld.a, when you run the generated exe, it will fail to do anything (both with VisualC++ and Dev-C++): at the first invocation of a mysql function the programme ends!... This is probably due to the need to link other libraries to your programme in order to use mysql as an EMBEDDED SERVER within your c++ programme instead of having to start mysql independently (as a separate service) before you can use it with your c++ application. I HAVE STILL TO READ ABOUT and RESEARCH this issue deeper... BTW, Yeoh wrote: >>I believe it was Kip Warner who created a DevPak for MySQL. :-) >>And it can be downloaded from Dev-C++ via Tools -> Check for >>Updates/Packages. I wonder if that DevPak also supports EMBEDDED mysql! Anyway it's sure worth a try... Thanks to all for your help! Josep -----Ursprungliche Nachricht----- Von: Vetrov Maxim [mailto:mu...@ma...] Gesendet: Montag, 8. Marz 2004 13:07 An: Josep Subirana Betreff: [Dev-C++] Trying to link libmysqld.lib (Update) Hi, I usually use next procedure to get library (.a) from libmysqld.dll: (1) pexports libmysqld.dll > libmysqld.def (2) dlltool --kill-at --input-def libmysqld.def --output-lib libmysqld.a then add the library to linker options in Dev-C++ (Project options->Parameters->Linker->Add Library or Object). That's it! The only problem that I do not know how long the func parameters of the libmysql are in terms of bytes and I do not know how to extract this information from the dll. But I found that I can determine it when I compile my code with mysql function calls. The compiler(linker) complains that it can't fund function xxxx@xx (e.g. I use mysql_close(), compilation ends in error like "can't find function mysql_close@4"), so I usually take the "at" and the following number (it's length in bytes of the func parameters) an manually add it to corresponding line in .def file, then recreate the library file (.a). Hope that I help. If you find a method to automatically get parameters length in .def file - can you share it? Best wishes, Muxas |
|
From: Per W. <pw...@ia...> - 2004-03-08 17:13:26
|
After a cursory glance, I have the following notes:
1) use <iostream> etc instead of <iostream.h>
2) specify "using std::cout" etc for things declared in header files
without the .h extension.
3) the Complesso::show() method has the printf arguments AFTER closing
parenthesis. You will get random numbers printed...
4) for efficiency, a program should not use printf() and std::cout at the
same time, since the two output functions needs to perform flush() all the
time to allow intermixed output.
5) your program should have:
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
6) your funz() may NOT call main - you should nevery try to call main()
yourself. It is only the startup code that may call main().
7) when you implement factorial, you either do it as a loop, or as a
recursive function taking the number as a parameter. Never create a
mathematical function that takes it's parameter on the stack!
/Per W
On Mon, 8 Mar 2004, Erika Brattich wrote:
>
>
>
>
> Hi guys!
> I have experienced a lot of problems programming with Dev-cpp 4.0; though, I
> continue to think that it is one of the most well-working application in order
> to program with C++ using Windows.
> So, I will make a list of my problems.
> First of all, I have some problems with the system of input/output. It seems
> that the program does not recognise cin >>...But it's probably my fault.
> This is the guilty program:
>
>
> #include <iostream.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <math.h>
> #include <complex.h>
>
>
>
> class Complesso
> {
> double re, im; /* le due componenti di un numero complesso*/
>
> public:
> Complesso(); /* costruttore di default */
> Complesso(double r, double i); /* costruttore con le due componenti */
> Complesso operator+ (Complesso c); /* overloading di '+' per la somma fra
> numeri complessi */
> Complesso operator-(Complesso d); /* overloading di '-' per la differenza
> fra numeri complessi */
> Complesso operator*(Complesso e); /* overloading di '*' per il prodotto fra
> numeri complessi */
> Complesso operator/(Complesso f); /* overloading di '/' per la divisione fra
> numeri complessi */
> Complesso operator=(double re);
> double show();
> };
> /* fine dichiarazioni */
>
>
>
> Complesso::Complesso()
> {
> re = 0;
> im = 0;
> }
>
> Complesso::Complesso(double r, double i)
> {
> re = r;
> im = i;
> }
>
> Complesso Complesso::operator+(Complesso c){
> /* overloading di '+' per la somma fra numeri complessi */
> Complesso a, b;
> c.re = a.re + b.re;
> c.im = a.im + b.im;
> return c;
> }
> Complesso Complesso::operator-(Complesso d){
> /* overloading di '-' per la differenza fra numeri complessi */
> Complesso a, b;
> d.re = a.re - b.re;
> d.im = a.im - b.im;
> return d;
> }
> Complesso Complesso::operator*(Complesso e){
> /* overloading di '*' per il prodotto fra numeri complessi.
> NOTA: il prodotto del numero Complesso (a + ib) per il numero complesso
> (c + id) da' come risultato il numero complesso
> (ac-bd) + i(ad+bc) */
> Complesso a, b;
> e.re = a.re*b.re - b.im*b.im;
> e.im = a.re*b.im + b.im*b.re;
> return e;
> }
> Complesso Complesso::operator/(Complesso f){
> /* overloading di '/' per la divisione fra numeri complessi.
> NOTA: la divisione del numero complesso (a + ib) per il numero complesso
> (c + id) e' definita solo se almeno uno fra c e d e' diverso da 0.
> Il risultato e' il numero complesso
> (ac + bd)/(c^2+d^2)+ i (bc - ad)/(c^2+d^2) */
>
> Complesso a, b;
> if (f.re!=0 || f.im!=0){
> f.re = (a.re*b.re + a.im*b.im)/(a.re*b.re + b.im*b.im);
> f.im = (a.im*b.re - a.re*b.im)/(a.re*b.re + b.im*b.im);
> }
> return f;
> };
> Complesso a, b, c, d, e, f;
>
> Complesso Complesso::operator=(double re)
> {
> c = c.re + c.im;
> return *this;
> }
> double Complesso::show()
> {
> printf("%lf, %lf"), c.re, c.im ;
> printf("c.re\n");
> printf("c.im\n");
>
> }
>
>
> int main()
> {
> cout <<"dammi a: ", cin >> (Complesso a);
> cout <<"\ndammi b: ", cin >> (Complesso b);
> c = a + b ;
> cout<< "la somma di a e b \350 c \n" ;
> c.show();
> system("PAUSE");
> return 0;
> }
>
> It is a classs that should do all the operstions between complex numbers, but
> it does'nt work very well.
> Dev-cpp doesn't show any fault, though.
>
> There is another version that works well on others pc, but on mine M_PI is not
> recognoised. Here it is:
>
> #include <iostream.h>
> #include <stdio.h>
> #include <math.h>
>
> class complex
> {
> double a[200], b[200], radice[2], somma[2], divisione[2], prodotto[2], x1[2],
> x2[2];
> double x, y, z, t, p1, p2, p3, Delta, RAD, modulo, theta;
> int i, n, h;
>
> public:
>
> int Avvio(int r);
> int Importa();
> int Somma();
> int Prodotto();
> int Divisione();
> int Radice();
> int Polinomio();
> };
>
> int complex::Avvio(int r)
> {
> switch(r)
> {
> case 1: {Somma(); break;}
> case 2: {Prodotto(); break;}
> case 3: {Divisione(); break;}
> case 4: {Radice(); break;}
> default: Polinomio();
> }
> }
>
> int complex::Importa()
> {
> printf("\nQuanti numeri complessi vuoi usare max[200]? ");
> scanf("%d", &n);
>
> printf("\nInserisci i coefficienti dei %d numeri.\n", n);
>
> for (i=0; i<n; i++)
> {
> printf("\na%d: ", i);
> scanf("%lf", &a[i]);
> printf("b%d: ", i);
> scanf("%lf", &b[i]);
> }
> }
>
> int complex::Somma()
> {
> Importa();
>
> somma[0]= a[0];
> somma[1]= b[0];
>
> for(i=1; i<n; i++)
> {
> somma[0]+= a[i];
> somma[1]+= b[i];
> }
>
> printf("\nSomma: %f", somma[0]);
> if (somma[1]>=0) printf("+%fi\n", somma[1]);
> else printf("%fi\n", somma[1]);
> }
>
> int complex::Prodotto()
> {
> Importa();
>
> prodotto[0]= a[0];
> prodotto[1]= b[0];
>
> for(i=1; i<n; i++)
> {
> x= prodotto[0]* a[i];
> y= prodotto[0]* b[i];
> z= prodotto[1]* a[i];
> t= prodotto[1]* b[i];
>
> prodotto[0]= x - t;
> prodotto[1]= y + z;
> }
>
> printf("\nProdotto: %f", prodotto[0]);
> if (prodotto[1]>=0) printf("+%fi\n", prodotto[1]);
> else printf("%fi\n", prodotto[1]);
> }
>
> int complex::Divisione()
> {
> printf("\nScrivi i coefficienti dei due numeri della divisione:\n");
> printf("\na0= ");
> scanf("%lf", &a[0]);
> printf("b0= ");
> scanf("%lf", &b[0]);
> printf("\na1= ");
> scanf("%lf", &a[1]);
> printf("b1= ");
> scanf("%lf", &b[1]);
>
> if(a[1]==0 && b[1]==0) printf("\nERRORE! DIVISIONE PER ZERO NON AMMESSA.\n");
> else
> {
>
> divisione[0]=(a[0]*a[1] - b[0]*(-b[1]))/(a[1]*a[1] + b[1]*b[1]);
> divisione[1]=(a[0]*(-b[1]) + b[0]*a[1])/(a[1]*a[1] + b[1]*b[1]);
>
> printf("\nDivisione: %f", divisione[0]);
> if (divisione[1]>=0) printf("+%fi\n", divisione[1]);
> else printf("%fi\n", divisione[1]);
> }
> }
>
> int complex::Radice()
> {
> printf("\nScrivi i coefficenti [a,b] e l'indice [k] della radice:\n");
>
> printf("\na= ");
> scanf("%lf", &a[0]);
> printf("b= ");
> scanf("%lf", &b[0]);
> printf("k= ");
> scanf("%d", &n);
>
> modulo=sqrt(a[0]*a[0] + b[0]*b[0]);
> theta=atan2(b[0],a[0]);
> x=pow(modulo,1./n);
>
> for(h=0; h<n; h++)
> {
> radice[0]=x*(cos((theta + 2*M_PI*h)/n));
> radice[1]=x*(sin((theta + 2*M_PI*h)/n));
>
> printf("\nZ(%d)= ", h); printf("%f", radice[0]);
> if (radice[1]>0) printf("+%fi\n", radice[1]);
> else printf("%fi\n", radice[1]);
> }
> }
>
> int complex::Polinomio()
> {
> printf("\nScrivi i coefficienti del polinomio\n");
> printf("\na= ");
> scanf("%lf", &p1);
> printf("b= ");
> scanf("%lf", &p2);
> printf("c= ");
> scanf("%lf", &p3);
>
> Delta=(p2*p2) - (4*p1*p3);
>
> if (Delta>=0)
> {
> RAD= sqrt(Delta);
> x1[0]= (-p2 + RAD)/(2*p1);
> x2[0]= (-p2 - RAD)/(2*p1);
>
> printf("\nx1= %f", x1[0]);
> printf("\nx2= %f\n", x2[0]);
> }
>
> else
> {
> RAD= ((-1)*(Delta));
>
> x1[0]= (-p2)/(2*p1);
> x1[1]= (RAD)/(2*p1);
> x2[0]= (-p2)/(2*p1);
> x2[1]= (-RAD)/(2*p1);
>
> printf("\nx1= %f", x1[0]);
> if (x1[1]>=0) printf("+%fi\n", x1[1]);
> else printf("%fi\n", x1[1]);
>
> printf("\nx2= %f", x2[0]);
> if (x2[1]>=0) printf("+%fi\n", x2[1]);
> else printf("%fi\n", x2[1]);
> }
> }
>
> int Richiesta()
> {
> int scelta;
> complex e;
>
> printf("\n[1] SOMMA di n numeri;");
> printf("\n[2] PRODOTTO di n numeri;");
> printf("\n[3] DIVISIONE tra 2 numeri;");
> printf("\n[4] RADICE k-esima di un numero;");
> printf("\n[5] RADICI di un polinomio di secondo grado;\n");
>
> printf("\nNumero scelto: ");
> scanf("%d", &scelta);
> if(scelta<1 || scelta>5)
> {
> printf("\nERRORE!!! NUMERO NON AMMESSO\n");
> Richiesta();
> }
> else
> {
> e.Avvio(scelta);
>
> char c;
> printf("\nSE SI VUOLE ESEGUIRE UN ALTRO CALCOLO PREMERE [s]o [S]: ");
> scanf("%s", &c);
> if(c=='s' || c=='S') Richiesta();
> }
> }
>
> int main()
> {
> printf("Questo programma esegue calcoli con i NUMERI COMPLESSI.");
> printf("\nDigita il numero indicato per utilizzare le varie operazioni:\n");
>
> Richiesta();
> } //
>
>
> But the most unexpecteded thing is in the last program: it works well on two
> others pcs, one has dev-cpp. It must give the factorial of a number, but when I
> execute it , it only returns the number followed by 0.000000...
> #include <stdio.h>
> #include <stdlib.h>
>
> long double l, n;
>
> int fattoriale ();
> int valori();
> int funz();
>
> int main()
> {
> printf("Scrivi il numero da fattorializzare: ");
> scanf("%Lf", &n);
>
> valori();
> fattoriale();
> funz();
> system("PAUSE");
> return 0;
> }
>
> int valori()
> {
> if((n>0) && (n<2000))
> {
> l=n-1;
> fattoriale();
> printf("Il fattoriale \350: %Le\n", n);
> }
> else if(n==0) printf ("Il fattoriale \350: 1\n");
> else if(n<0) printf ("Non posso calcolare il fattoriale di un numero
> negativo\n");
> else printf ("Non posso calcolare il fattoriale, il numero \350 troppo
> elevato\n");
> funz();
> }
>
> int fattoriale()
> {
> while(l>1)
> {
> n=n*l--;
> fattoriale();
> }
> }
>
> int funz()
> {
> char c;
> printf ("Vuoi calcolare un altro fattoriale? Premere [s] o [S] se si: \n", c);
> scanf("%s", &c);
> if(c=='s'|| c=='S') main();
> else printf ("Esecuzione terminata\n");
> }
>
> And it worked well even with another C program. Now I will try to execute them
> with dev-cpp 5.0 because I think that it isn't only my fault and my loss of
> experience. Could you help me to find the bugs?
>
> Thank you
>
> Erika
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> 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: Erika B. <eri...@st...> - 2004-03-08 16:44:26
|
Hi guys!
I have experienced a lot of problems programming with Dev-cpp 4.0; though, I
continue to think that it is one of the most well-working application in order
to program with C++ using Windows.
So, I will make a list of my problems.
First of all, I have some problems with the system of input/output. It seems
that the program does not recognise cin >>...But it's probably my fault.
This is the guilty program:
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <complex.h>
class Complesso
{
double re, im; /* le due componenti di un numero complesso*/
public:
Complesso(); /* costruttore di default */
Complesso(double r, double i); /* costruttore con le due componenti */
Complesso operator+ (Complesso c); /* overloading di '+' per la somma fra
numeri complessi */
Complesso operator-(Complesso d); /* overloading di '-' per la differenza
fra numeri complessi */
Complesso operator*(Complesso e); /* overloading di '*' per il prodotto fra
numeri complessi */
Complesso operator/(Complesso f); /* overloading di '/' per la divisione fra
numeri complessi */
Complesso operator=(double re);
double show();
};
/* fine dichiarazioni */
Complesso::Complesso()
{
re = 0;
im = 0;
}
Complesso::Complesso(double r, double i)
{
re = r;
im = i;
}
Complesso Complesso::operator+(Complesso c){
/* overloading di '+' per la somma fra numeri complessi */
Complesso a, b;
c.re = a.re + b.re;
c.im = a.im + b.im;
return c;
}
Complesso Complesso::operator-(Complesso d){
/* overloading di '-' per la differenza fra numeri complessi */
Complesso a, b;
d.re = a.re - b.re;
d.im = a.im - b.im;
return d;
}
Complesso Complesso::operator*(Complesso e){
/* overloading di '*' per il prodotto fra numeri complessi.
NOTA: il prodotto del numero Complesso (a + ib) per il numero complesso
(c + id) da' come risultato il numero complesso
(ac-bd) + i(ad+bc) */
Complesso a, b;
e.re = a.re*b.re - b.im*b.im;
e.im = a.re*b.im + b.im*b.re;
return e;
}
Complesso Complesso::operator/(Complesso f){
/* overloading di '/' per la divisione fra numeri complessi.
NOTA: la divisione del numero complesso (a + ib) per il numero complesso
(c + id) e' definita solo se almeno uno fra c e d e' diverso da 0.
Il risultato e' il numero complesso
(ac + bd)/(c^2+d^2)+ i (bc - ad)/(c^2+d^2) */
Complesso a, b;
if (f.re!=0 || f.im!=0){
f.re = (a.re*b.re + a.im*b.im)/(a.re*b.re + b.im*b.im);
f.im = (a.im*b.re - a.re*b.im)/(a.re*b.re + b.im*b.im);
}
return f;
};
Complesso a, b, c, d, e, f;
Complesso Complesso::operator=(double re)
{
c = c.re + c.im;
return *this;
}
double Complesso::show()
{
printf("%lf, %lf"), c.re, c.im ;
printf("c.re\n");
printf("c.im\n");
}
int main()
{
cout <<"dammi a: ", cin >> (Complesso a);
cout <<"\ndammi b: ", cin >> (Complesso b);
c = a + b ;
cout<< "la somma di a e b \350 c \n" ;
c.show();
system("PAUSE");
return 0;
}
It is a classs that should do all the operstions between complex numbers, but
it does'nt work very well.
Dev-cpp doesn't show any fault, though.
There is another version that works well on others pc, but on mine M_PI is not
recognoised. Here it is:
#include <iostream.h>
#include <stdio.h>
#include <math.h>
class complex
{
double a[200], b[200], radice[2], somma[2], divisione[2], prodotto[2], x1[2],
x2[2];
double x, y, z, t, p1, p2, p3, Delta, RAD, modulo, theta;
int i, n, h;
public:
int Avvio(int r);
int Importa();
int Somma();
int Prodotto();
int Divisione();
int Radice();
int Polinomio();
};
int complex::Avvio(int r)
{
switch(r)
{
case 1: {Somma(); break;}
case 2: {Prodotto(); break;}
case 3: {Divisione(); break;}
case 4: {Radice(); break;}
default: Polinomio();
}
}
int complex::Importa()
{
printf("\nQuanti numeri complessi vuoi usare max[200]? ");
scanf("%d", &n);
printf("\nInserisci i coefficienti dei %d numeri.\n", n);
for (i=0; i<n; i++)
{
printf("\na%d: ", i);
scanf("%lf", &a[i]);
printf("b%d: ", i);
scanf("%lf", &b[i]);
}
}
int complex::Somma()
{
Importa();
somma[0]= a[0];
somma[1]= b[0];
for(i=1; i<n; i++)
{
somma[0]+= a[i];
somma[1]+= b[i];
}
printf("\nSomma: %f", somma[0]);
if (somma[1]>=0) printf("+%fi\n", somma[1]);
else printf("%fi\n", somma[1]);
}
int complex::Prodotto()
{
Importa();
prodotto[0]= a[0];
prodotto[1]= b[0];
for(i=1; i<n; i++)
{
x= prodotto[0]* a[i];
y= prodotto[0]* b[i];
z= prodotto[1]* a[i];
t= prodotto[1]* b[i];
prodotto[0]= x - t;
prodotto[1]= y + z;
}
printf("\nProdotto: %f", prodotto[0]);
if (prodotto[1]>=0) printf("+%fi\n", prodotto[1]);
else printf("%fi\n", prodotto[1]);
}
int complex::Divisione()
{
printf("\nScrivi i coefficienti dei due numeri della divisione:\n");
printf("\na0= ");
scanf("%lf", &a[0]);
printf("b0= ");
scanf("%lf", &b[0]);
printf("\na1= ");
scanf("%lf", &a[1]);
printf("b1= ");
scanf("%lf", &b[1]);
if(a[1]==0 && b[1]==0) printf("\nERRORE! DIVISIONE PER ZERO NON AMMESSA.\n");
else
{
divisione[0]=(a[0]*a[1] - b[0]*(-b[1]))/(a[1]*a[1] + b[1]*b[1]);
divisione[1]=(a[0]*(-b[1]) + b[0]*a[1])/(a[1]*a[1] + b[1]*b[1]);
printf("\nDivisione: %f", divisione[0]);
if (divisione[1]>=0) printf("+%fi\n", divisione[1]);
else printf("%fi\n", divisione[1]);
}
}
int complex::Radice()
{
printf("\nScrivi i coefficenti [a,b] e l'indice [k] della radice:\n");
printf("\na= ");
scanf("%lf", &a[0]);
printf("b= ");
scanf("%lf", &b[0]);
printf("k= ");
scanf("%d", &n);
modulo=sqrt(a[0]*a[0] + b[0]*b[0]);
theta=atan2(b[0],a[0]);
x=pow(modulo,1./n);
for(h=0; h<n; h++)
{
radice[0]=x*(cos((theta + 2*M_PI*h)/n));
radice[1]=x*(sin((theta + 2*M_PI*h)/n));
printf("\nZ(%d)= ", h); printf("%f", radice[0]);
if (radice[1]>0) printf("+%fi\n", radice[1]);
else printf("%fi\n", radice[1]);
}
}
int complex::Polinomio()
{
printf("\nScrivi i coefficienti del polinomio\n");
printf("\na= ");
scanf("%lf", &p1);
printf("b= ");
scanf("%lf", &p2);
printf("c= ");
scanf("%lf", &p3);
Delta=(p2*p2) - (4*p1*p3);
if (Delta>=0)
{
RAD= sqrt(Delta);
x1[0]= (-p2 + RAD)/(2*p1);
x2[0]= (-p2 - RAD)/(2*p1);
printf("\nx1= %f", x1[0]);
printf("\nx2= %f\n", x2[0]);
}
else
{
RAD= ((-1)*(Delta));
x1[0]= (-p2)/(2*p1);
x1[1]= (RAD)/(2*p1);
x2[0]= (-p2)/(2*p1);
x2[1]= (-RAD)/(2*p1);
printf("\nx1= %f", x1[0]);
if (x1[1]>=0) printf("+%fi\n", x1[1]);
else printf("%fi\n", x1[1]);
printf("\nx2= %f", x2[0]);
if (x2[1]>=0) printf("+%fi\n", x2[1]);
else printf("%fi\n", x2[1]);
}
}
int Richiesta()
{
int scelta;
complex e;
printf("\n[1] SOMMA di n numeri;");
printf("\n[2] PRODOTTO di n numeri;");
printf("\n[3] DIVISIONE tra 2 numeri;");
printf("\n[4] RADICE k-esima di un numero;");
printf("\n[5] RADICI di un polinomio di secondo grado;\n");
printf("\nNumero scelto: ");
scanf("%d", &scelta);
if(scelta<1 || scelta>5)
{
printf("\nERRORE!!! NUMERO NON AMMESSO\n");
Richiesta();
}
else
{
e.Avvio(scelta);
char c;
printf("\nSE SI VUOLE ESEGUIRE UN ALTRO CALCOLO PREMERE [s]o [S]: ");
scanf("%s", &c);
if(c=='s' || c=='S') Richiesta();
}
}
int main()
{
printf("Questo programma esegue calcoli con i NUMERI COMPLESSI.");
printf("\nDigita il numero indicato per utilizzare le varie operazioni:\n");
Richiesta();
} //
But the most unexpecteded thing is in the last program: it works well on two
others pcs, one has dev-cpp. It must give the factorial of a number, but when I
execute it , it only returns the number followed by 0.000000...
#include <stdio.h>
#include <stdlib.h>
long double l, n;
int fattoriale ();
int valori();
int funz();
int main()
{
printf("Scrivi il numero da fattorializzare: ");
scanf("%Lf", &n);
valori();
fattoriale();
funz();
system("PAUSE");
return 0;
}
int valori()
{
if((n>0) && (n<2000))
{
l=n-1;
fattoriale();
printf("Il fattoriale \350: %Le\n", n);
}
else if(n==0) printf ("Il fattoriale \350: 1\n");
else if(n<0) printf ("Non posso calcolare il fattoriale di un numero
negativo\n");
else printf ("Non posso calcolare il fattoriale, il numero \350 troppo
elevato\n");
funz();
}
int fattoriale()
{
while(l>1)
{
n=n*l--;
fattoriale();
}
}
int funz()
{
char c;
printf ("Vuoi calcolare un altro fattoriale? Premere [s] o [S] se si: \n", c);
scanf("%s", &c);
if(c=='s'|| c=='S') main();
else printf ("Esecuzione terminata\n");
}
And it worked well even with another C program. Now I will try to execute them
with dev-cpp 5.0 because I think that it isn't only my fault and my loss of
experience. Could you help me to find the bugs?
Thank you
Erika
|
|
From: <cx...@vi...> - 2004-03-08 11:36:54
|
______________________________________ =================================================================== |
|
From: Hossein H. <ult...@em...> - 2004-03-08 08:20:25
|
Hi Sriram, > Is this a school assignment? > > Read as string > Split into tokens > Build parse tree > Optimize parse tree > Traverse optimized tree to emit answer Whether it is or not, my rule of thumb is that the following solution is one of the best, and the most mdern one: > > now i have to read a mathematical expression from the console as a string and then do some calcultions with it. > > how do i go about performing calculation. > > the expression or eqn contains operators like +, -, / etc and also variables i.e alphabets like x,y etc.. in addition to numbers. > > > > is there some other to read the data rather than reading it into a string. > > > > or can something be done so that numerical calculations can be made. > > > > ex: read "2+3-x" should be able to output 5-x as the answer. Provided that you've got plausible methods to work with strings literals containg integers, using stringstreams is the best way! Regards, --Hossein -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
|
From: Hossein H. <ult...@em...> - 2004-03-08 08:19:41
|
Hi Sriram, > Is this a school assignment? > > Read as string > Split into tokens > Build parse tree > Optimize parse tree > Traverse optimized tree to emit answer Whether it is or not, my rule of thumb is that the following solution is one of the best, and the most mdern one: > > now i have to read a mathematical expression from the console as a string and then do some calcultions with it. > > how do i go about performing calculation. > > the expression or eqn contains operators like +, -, / etc and also variables i.e alphabets like x,y etc.. in addition to numbers. > > > > is there some other to read the data rather than reading it into a string. > > > > or can something be done so that numerical calculations can be made. > > > > ex: read "2+3-x" should be able to output 5-x as the answer. Provided that you've got plausible methods to work with strings literals containg integers, using stringst -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
|
From: Yeoh HS <ye...@ye...> - 2004-03-08 07:42:30
|
Oladipo Odumosu wrote: > Dear all, > about the mysql lib thing, you can't link a MSVC++/BCB library with > MinGW/gcc. you can create an import library (like Josef did), but i > never tried that, so i don't know if it'll work. i still think impdef is > the way to go, but then, i might not know too much. try searching for > 'MySQL' and 'MinGW' in Google. there was a person who supplied a devpak > that contained a mysql library file (never tested it). i think it was > YeohHS or something like that. (no offence meant, please). > Hello, I believe it was Kip Warner who created a DevPak for MySQL. :-) And it can be downloaded from Dev-C++ via Tools -> Check for Updates/Packages. > i'm a Nigerian, and while i understand that many of my countrymen are > involved in fraudulent schemes, it still hurts to find out that almost > everyone in Nigeria is labelled as a fraudster. i've been on this list > for almost a year now, and while i'm not an active poster (like Per, > Balazs, or Mohanlec) (if i miss the spelling, pls excuse me?), i've > never tried to defraud anyone. pls, help me out, okay? thanks in advance. > Okay, no problem. :-) I don't believe every Nigerian is a fraudster. Best Regards, Yeoh -- |
|
From: <gen...@ya...> - 2004-03-08 06:34:08
|
Dear all, about the mysql lib thing, you can't link a MSVC++/BCB library with MinGW/gcc. you can create an import library (like Josef did), but i never tried that, so i don't know if it'll work. i still think impdef is the way to go, but then, i might not know too much. try searching for 'MySQL' and 'MinGW' in Google. there was a person who supplied a devpak that contained a mysql library file (never tested it). i think it was YeohHS or something like that. (no offence meant, please). i'm a Nigerian, and while i understand that many of my countrymen are involved in fraudulent schemes, it still hurts to find out that almost everyone in Nigeria is labelled as a fraudster. i've been on this list for almost a year now, and while i'm not an active poster (like Per, Balazs, or Mohanlec) (if i miss the spelling, pls excuse me?), i've never tried to defraud anyone. pls, help me out, okay? thanks in advance. --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now |
|
From: <or...@vp...> - 2004-03-07 21:28:35
|
Josep Subirana wrote: > By linking directly to libmysqld.dll instead of .a or .lib, the same er= rors > occur! Could you create an archive of the lib, dll, def, .a, headers, sources=20 (actually everything required to compile your app), and put it up=20 somewhere, so I can download and experiment? If you cannot put it up anywhere, then send it to this address (as a=20 last resort): or...@di... -- Greetings, Bal=E1zs |