dev-cpp-users Mailing List for Dev-C++ (Page 647)
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: <Ech...@ne...> - 2001-11-15 21:41:52
|
I assume you mean to compile it, and that the program is in a file called harmonic.c
Since dev-cpp uses gcc as it's compiler, I think you would youise the following command, from the file's directory:
gcc harmonic.c -o harmonic.exe
however, since it is a windows compiler, it might need other options? :-)
---- message follows ----
Please show me step-by-step how to use DevC++ to run a program through
Command Line method fpr the following program. Thank you!!!!!!!!!!!!!!
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
//----------------------------------------------------------------------------
----
// array passed as pointer
float sum_array( float *A, int len )
{
float s = 0;
for( int i = 0; i < len; ++i )
s += A[i];
return s;
}
// array passed as array of unspecified length
float average_array( float A[], int len )
{
return sum_array( A, len )/len;
}
//----------------------------------------------------------------------------
----
void main( int argc, char **argv )
{
if( argc != 1 )
{
cerr << "Usage: " << argv[0] << " number" << endl;
cerr <<"int argc: "<<argc;
getchar();
exit(0);
}
int n = atoi( argv[1] );
float H[n];
for( int i = 1; i <= n; ++i )
H[i-1] = 1/float(i);
cout << "harmonic number " << n << ": " << sum_array( H, n ) << endl;
cout << "average 1/i up to " << n << ": " << average_array( H, n ) <<
endl;
exit(0);
}
//--------------------------------
------------------------------------------------
--
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
|
|
From: Dario P. <do...@ho...> - 2001-11-15 12:10:49
|
/* Let m be an integer, greater than zero but less than eleven. Numerical strings, in which each digit is greater or equal to 0 but less than m, are numbers of the number system in the base m. The numbers 10110 and 1981, for example, are numbers of the number system in the base the 10, but only the first one is a number of the number system in the base 2. The zeros at the beginning of the number are leading zeros, unless the number is 0. Write a program that reads the integers m and n, and outputs all numbers of the number system in the base m containing n digits at the most, and without leading zeros. Each number may be output only once. You may assume that m is greater than 0, but less than 11, and that n is greater than 0 but less than 81. The numbers should be output on consecutive lines, one number per line */ I've been banging my head over this problem since last week, and i'm no closer to an answer than i was when i started. I find myself always coming back to the idea of implementing a bidimensional array as such: nsys[n][m] But i can't figure out the system of loops and conditions that would correctly solve this problem. I'm hopelessly stuck. I'll keep banging my head, but i doubt i'll answer this. I thought i'd ask for some help. Some clever hints would be better than the straight answer, as i would like to figure out as much of it by myself as i can. But i really need help. Thanks... adios, biterman. <<That government is best which governs the least... that government is best which governs not at all.>> _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |
|
From: <Cuo...@ao...> - 2001-11-15 06:41:43
|
Please show me step-by-step how to use DevC++ to run a program through
Command Line method fpr the following program. Thank you!!!!!!!!!!!!!!
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
//----------------------------------------------------------------------------
----
// array passed as pointer
float sum_array( float *A, int len )
{
float s = 0;
for( int i = 0; i < len; ++i )
s += A[i];
return s;
}
// array passed as array of unspecified length
float average_array( float A[], int len )
{
return sum_array( A, len )/len;
}
//----------------------------------------------------------------------------
----
void main( int argc, char **argv )
{
if( argc != 1 )
{
cerr << "Usage: " << argv[0] << " number" << endl;
cerr <<"int argc: "<<argc;
getchar();
exit(0);
}
int n = atoi( argv[1] );
float H[n];
for( int i = 1; i <= n; ++i )
H[i-1] = 1/float(i);
cout << "harmonic number " << n << ": " << sum_array( H, n ) << endl;
cout << "average 1/i up to " << n << ": " << average_array( H, n ) <<
endl;
exit(0);
}
//--------------------------------
------------------------------------------------
|
|
From: Brian M. <str...@ho...> - 2001-11-13 23:47:04
|
How do I make graphical windows applications using dev-cpp? _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |
|
From: St0fF 6. <st...@gm...> - 2001-11-13 22:21:58
|
Hi all! Yes, yes, and again yes! We all are right. I learned recursion by using factorials, but our computer science teacher was pretty much as I am. He showed us the extra-time recursion needs for 'stacking', and as an exercise he wanted us to implement such recursive functions iteratively. That's why my Idea was as it was. And yes: one of the first recursions in my life was the fibo-seq. Another one was Sierpinski, whích is more of a problem to implement iteratively ... At this point I would like to hear from Mansoor, because we really showed off some knowledge and don't know if it helped ... Greets! St0fF. |
|
From: St0fF 6. <st...@gm...> - 2001-11-13 22:21:57
|
Hi, I think the pupose of devcpp is not to do it like microshit does. also it uses a different compiler, so you'd have to convert the libraries (*.lib) to mingw-format (*.a). Why don't you use VC if you need MFC's? St0fF. ----- Original Message ----- From: "kazim siddiqui" <kaz...@ho...> To: <dev...@li...> Sent: Sunday, November 11, 2001 7:21 PM Subject: [Dev-C++] anyone help me > how can I use MFC (microsoft foundation classes) in Dev-C++....is afxwin.h > builtin in Dev-C++....do I have to set some parameters for it.....I m using > Dev-C++ version 4. > regards, > khawar > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Julio L. <ju2...@ya...> - 2001-11-13 22:12:19
|
create a dev-c++ project and add the source code file to the project. In the project options add -lglu32 -lglaux -lopengl32 (or -lopengl, forgot which one) and then recompile project.... _______________________________________________ Message: 4Date: Tue, 13 Nov 2001 15:11:23 +0100 Organization: http://freemail.web.de/From: "Max Palitza" <Max...@we...> To: dev...@li...: [Dev-C++] Problem with OpenGL Hi everybody! I've got a problem with compiling OpenGL code written in C. When I want to compile this code#include <windows.h> #include <gl\gl.h> #include <gl\glu.h> #include <gl\glaux.h>int main(int argc, char** argv){ auxInitDisplayMode (AUX_SINGLE | AUX_RGBA); auxInitPosition (0, 0, 500, 500); auxInitWindow (argv[0]); glClearColor (0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0, 1.0, 1.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); glBegin(GL_POLYGON); glVertex2f(-0.5, -0.5); glVertex2f(-0.5, 0.5); glVertex2f(0.5, 0.5); glVertex2f(0.5, -0.5); glEnd(); glFlush(); return 0;} it reports that <i>all</i> funcs used are unknown! I am quite sure that there's a problem with the .h files cause in VC++ I got it compiling. Could someone please tell me what to do in order to get this problem solved? Thanks,Max___ ===== Julio __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com |
|
From: Ioannis V. <no...@ya...> - 2001-11-13 21:14:15
|
If it was for academic purposes to learn recursion, i agree with you too. :) Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: Williams, Timothy W. [mailto:TIM...@sa...] > Sent: Tuesday, November 13, 2001 10:24 PM > To: 'Ioannis Vranos'; Dev-C++ > Subject: RE: [Dev-C++] Efficiency > > > Good grief! I concur too. Let me explain my point a bit > clearer here: o I assumed he was constrained to solving the > problem recursively. o I made that assumption because a > frequently used method of teaching recursion includes using a > simple problemset, ie. fibonacci. o This is mainly because > once situations are complex enough to need recursion, if a > person doesn't already know it then they are stuck, for > instance learning how to implement a B+Tree and traversing it > is a good time to *already* know recursion. > o If all he wanted was a fast way to compute the fib > sequence, he probably should have asked "how can I make this > funcion more efficient" rather than "how can I make this > recursive function more efficient" then I would have been > less likely to make assumptions about his constraints. > o He could clear it up by letting us know what his > constraints were or were not. > > I'm not arguing for a recursive solution in this case if he's > doing it for any *real* purpose, although I must say I didn't > see any significant performance difference for any relatively > small n. Just out of curiousity how did you initially learn > recursion? I'm guessing it wasn't implementing a tree > structure for the first time, right? Probably the fib > sequence, I think it's most ever intro to CS book out there. |
|
From: Williams, T. W. <TIM...@sa...> - 2001-11-13 20:32:06
|
Good grief! I concur too. Let me explain my point a bit clearer here: o I assumed he was constrained to solving the problem recursively. o I made that assumption because a frequently used method of teaching recursion includes using a simple problemset, ie. fibonacci. o This is mainly because once situations are complex enough to need recursion, if a person doesn't already know it then they are stuck, for instance learning how to implement a B+Tree and traversing it is a good time to *already* know recursion. o If all he wanted was a fast way to compute the fib sequence, he probably should have asked "how can I make this funcion more efficient" rather than "how can I make this recursive function more efficient" then I would have been less likely to make assumptions about his constraints. o He could clear it up by letting us know what his constraints were or were not. I'm not arguing for a recursive solution in this case if he's doing it for any *real* purpose, although I must say I didn't see any significant performance difference for any relatively small n. Just out of curiousity how did you initially learn recursion? I'm guessing it wasn't implementing a tree structure for the first time, right? Probably the fib sequence, I think it's most ever intro to CS book out there. --tim > -----Original Message----- > From: Ioannis Vranos [mailto:no...@ya...] > Sent: Tuesday, November 13, 2001 2:52 PM > To: Dev-C++ > Subject: RE: [Dev-C++] Efficiency > > > I astrongly agree with St0fF here. Recursion has time cost due to > continuous function calls and space cost because of the storage of the > function calls in the stack (or in the automatic storage if > you prefer). > This applies to fibonacci too. > > > Ioannis > > * Ioannis Vranos > * Programming pages: http://www.noicys.f2s.com > * Alternative URL: http://run.to/noicys > > > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...] On Behalf > > Of St0fF 64 > > Sent: Tuesday, November 13, 2001 5:48 PM > > To: DevCPP; Williams, Timothy W. > > Subject: Re: [Dev-C++] Efficiency > > > > > > Hi! > > As I said, iteration speeds it all up because no unneccessary > > Stacking, > > meaning: push return address, recursive recall, push return > > address, recursive recall, ... , recursive recall, return > > solution, pop return address, return solution, ... , pop > > return address, return solution, finished. This is the > > negative effect of recursion. In the iterative version we do > > counting instead of accessing the stack. The dealing with > > return addresses and the stack is not used in iteration. > > Thats why it is faster. St0fF. > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Jason H. <jas...@bt...> - 2001-11-13 20:17:18
|
In the win32 reference I have found an api call - GetVersionEx() that = should return the information you need, however I don't know what value = will be returned for Windows XP. It something for you to look into = anyway. Jason. ----- Original Message -----=20 From: Stein Nyg=E5rd=20 To: DevCpp=20 Sent: Tuesday, November 13, 2001 7:35 PM Subject: [Dev-C++] Different paths in windows? Hi all! I've just finished my latest screensaver-project... Now I have begun = coding on some installer-prog, but I have a problem. How will I know = where to install the *.scr file? In Windows 98 it should be in = C:/windows but in XP it should be in C:/windows/system32... how do i = check stuff like this? Thanks! stein |
|
From: Ioannis V. <no...@ya...> - 2001-11-13 19:52:34
|
I astrongly agree with St0fF here. Recursion has time cost due to continuous function calls and space cost because of the storage of the function calls in the stack (or in the automatic storage if you prefer). This applies to fibonacci too. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of St0fF 64 > Sent: Tuesday, November 13, 2001 5:48 PM > To: DevCPP; Williams, Timothy W. > Subject: Re: [Dev-C++] Efficiency >=20 >=20 > Hi! > As I said, iteration speeds it all up because no unneccessary=20 > Stacking, > meaning: push return address, recursive recall, push return=20 > address, recursive recall, ... , recursive recall, return=20 > solution, pop return address, return solution, ... , pop=20 > return address, return solution, finished. This is the=20 > negative effect of recursion. In the iterative version we do=20 > counting instead of accessing the stack. The dealing with=20 > return addresses and the stack is not used in iteration. =20 > Thats why it is faster. St0fF. |
|
From: <ste...@ge...> - 2001-11-13 19:39:03
|
Hi all! I've just finished my latest screensaver-project... Now I have begun = coding on some installer-prog, but I have a problem. How will I know = where to install the *.scr file? In Windows 98 it should be in = C:/windows but in XP it should be in C:/windows/system32... how do i = check stuff like this? Thanks! stein |
|
From: St0fF 6. <st...@gm...> - 2001-11-13 15:46:48
|
Hi!
As I said, iteration speeds it all up because no unneccessary Stacking,
meaning: push return address, recursive recall, push return address,
recursive recall, ... , recursive recall, return solution, pop return
address, return solution, ... , pop return address, return solution,
finished.
This is the negative effect of recursion. In the iterative version we do
counting instead of accessing the stack. The dealing with return addresses
and the stack is not used in iteration. Thats why it is faster.
St0fF.
----- Original Message -----
From: "Williams, Timothy W." <TIM...@sa...>
To: "'St0fF 64'" <st...@gm...>; "DevCPP"
<Dev...@li...>
Sent: Tuesday, November 13, 2001 1:54 PM
Subject: RE: [Dev-C++] Efficiency
> The fibonacci sequence is given alot as an introduction to recursion so
that
> one isn't first learning recursion at the same time they're learning how
to
> navigate BTree. That being the case, I assumed he was constrained to
> solving the problem with recursion and I just gave him a more efficient
way
> to do it. I also don't see any significant performance difference between
> our two solutions, did you?
>
> >>(, and btw. you need more variables ...).
> what's that about?
>
> --tim
>
> > -----Original Message-----
> > From: St0fF 64 [mailto:st...@gm...]
> > Sent: Tuesday, November 13, 2001 7:26 AM
> > To: DevCPP
> > Subject: Re: [Dev-C++] Efficiency
> >
> >
> > HI!
> > Recursive functions normally need a lot more time -> wanna
> > speed it up -
> > ITERATE (do it in one for() / while() construct using only
> > ONE FUNCTION
> > CALL).
> > maybe I'll get it right:
> >
> > int fibonacci_iterated(int max) {
> > if (max<0) {return 0;}
> > else {/*register*/ int n=0, m=1,o=1;
> > for(int i=0;i<=max;i++) {
> > m+=n; n=o; o=m;}
> > return o;}
> > }
> >
> > I mean, if you use C then use it right! I know some
> > functions are very easy
> > coded recursively,
> > but this implies a lot of stacking and jumping around, and
> > therefore it
> > needs a lot of extra - calling - time. So if a recursive
> > function should
> > get speeded up, you have to count upwards instead of
> > downwards. You need to
> > iterate instead of recursing (, and btw. you need more variables ...).
> > Hope this helps,
> > St0fF.
> > ----- Original Message -----
> > From: "Williams, Timothy W." <TIM...@sa...>
> > To: "'Mansoor Nathani'" <man...@sy...>; "Dev users"
> > <dev...@li...>
> > Sent: Friday, November 09, 2001 10:11 PM
> > Subject: RE: [Dev-C++] Efficiency
> >
> >
> > > #include <iostream.h>
> > > #include <stdlib.h>
> > > int fib(int z);
> > > int fib_iter(int a, int b, int count);
> > >
> > > void main(void)
> > > {
> > > int n;
> > > cout << "Enter n:\n";
> > > cin >> n;
> > > cout << "My Way...\n";
> > > cout << fib_iter(1, 0, n);
> > > cout << "\n and now your way...\n";
> > > cout << fib(n);
> > >
> > > }
> > >
> > >
> > > int fib_iter(int a, int b, int count)
> > > {
> > > if (count == 0)
> > > return 1;
> > > else
> > > return a+fib_iter(a+b, a, count-1);
> > >
> > > }
> > > int fib(int z)
> > > {
> > > if (z==-1)
> > > return 1;
> > > if (z==-2)
> > > return 0;
> > > else
> > > return (fib(z-1)+fib(z-2));
> > > }
> > >
> > >
> > > > -----Original Message-----
> > > > From: Mansoor Nathani [mailto:man...@sy...]
> > > > Sent: Friday, November 09, 2001 3:46 PM
> > > > To: Dev users
> > > > Subject: [Dev-C++] Efficiency
> > > >
> > > >
> > > > Can any one please show me how to increase the efficiency of this
> > > > recursive program?
> > > >
> > > > THe program is supposed to output the fibonacci sequence
> > up to a given
> > > > value.
> > > >
> > > > I need it to output in the middle of the recursive function, but
> > > > a lot of garbage gets acumulated.
> > > >
> > > > Any help would be appreciated.
> > > >
> > > > Thanks
> > > >
> > > > Mansoor
> > > >
> > > >
> > > > #include <iostream.h>
> > > > int fib(int z);
> > > >
> > > > void main(void)
> > > > {
> > > > int c;
> > > > for (int abc=0;abc<10;abc++)
> > > > cout<<fib(abc)<<endl;
> > > > cin>>c;
> > > > }
> > > >
> > > > int fib(int z)
> > > > {
> > > > if (z==-1)
> > > > return 1;
> > > > if (z==-2)
> > > > return 0;
> > > > else
> > > > return (fib(z-1)+fib(z-2));
> > > > }
> > > >
> > > > _______________________________________________
> > > > Dev-cpp-users mailing list
> > > > Dev...@li...
> > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> > > >
> > >
> > > _______________________________________________
> > > Dev-cpp-users mailing list
> > > Dev...@li...
> > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Max P. <Max...@we...> - 2001-11-13 14:11:46
|
Hi everybody!
I've got a problem with compiling OpenGL code written in C. When I want to compile this code
#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>
int main(int argc, char** argv)
{
auxInitDisplayMode (AUX_SINGLE | AUX_RGBA);
auxInitPosition (0, 0, 500, 500);
auxInitWindow (argv[0]);
glClearColor (0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glBegin(GL_POLYGON);
glVertex2f(-0.5, -0.5);
glVertex2f(-0.5, 0.5);
glVertex2f(0.5, 0.5);
glVertex2f(0.5, -0.5);
glEnd();
glFlush();
return 0;
}
it reports that <i>all</i> funcs used are unknown! I am quite sure that there's a problem with the .h files cause in VC++ I got it compiling. Could someone please tell me what to do in order to get this problem solved?
Thanks,
Max
______________________________________________________________________________
Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr!
Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=7
|
|
From: Williams, T. W. <TIM...@sa...> - 2001-11-13 12:54:39
|
The fibonacci sequence is given alot as an introduction to recursion so that
one isn't first learning recursion at the same time they're learning how to
navigate BTree. That being the case, I assumed he was constrained to
solving the problem with recursion and I just gave him a more efficient way
to do it. I also don't see any significant performance difference between
our two solutions, did you?
>>(, and btw. you need more variables ...).
what's that about?
--tim
> -----Original Message-----
> From: St0fF 64 [mailto:st...@gm...]
> Sent: Tuesday, November 13, 2001 7:26 AM
> To: DevCPP
> Subject: Re: [Dev-C++] Efficiency
>
>
> HI!
> Recursive functions normally need a lot more time -> wanna
> speed it up -
> ITERATE (do it in one for() / while() construct using only
> ONE FUNCTION
> CALL).
> maybe I'll get it right:
>
> int fibonacci_iterated(int max) {
> if (max<0) {return 0;}
> else {/*register*/ int n=0, m=1,o=1;
> for(int i=0;i<=max;i++) {
> m+=n; n=o; o=m;}
> return o;}
> }
>
> I mean, if you use C then use it right! I know some
> functions are very easy
> coded recursively,
> but this implies a lot of stacking and jumping around, and
> therefore it
> needs a lot of extra - calling - time. So if a recursive
> function should
> get speeded up, you have to count upwards instead of
> downwards. You need to
> iterate instead of recursing (, and btw. you need more variables ...).
> Hope this helps,
> St0fF.
> ----- Original Message -----
> From: "Williams, Timothy W." <TIM...@sa...>
> To: "'Mansoor Nathani'" <man...@sy...>; "Dev users"
> <dev...@li...>
> Sent: Friday, November 09, 2001 10:11 PM
> Subject: RE: [Dev-C++] Efficiency
>
>
> > #include <iostream.h>
> > #include <stdlib.h>
> > int fib(int z);
> > int fib_iter(int a, int b, int count);
> >
> > void main(void)
> > {
> > int n;
> > cout << "Enter n:\n";
> > cin >> n;
> > cout << "My Way...\n";
> > cout << fib_iter(1, 0, n);
> > cout << "\n and now your way...\n";
> > cout << fib(n);
> >
> > }
> >
> >
> > int fib_iter(int a, int b, int count)
> > {
> > if (count == 0)
> > return 1;
> > else
> > return a+fib_iter(a+b, a, count-1);
> >
> > }
> > int fib(int z)
> > {
> > if (z==-1)
> > return 1;
> > if (z==-2)
> > return 0;
> > else
> > return (fib(z-1)+fib(z-2));
> > }
> >
> >
> > > -----Original Message-----
> > > From: Mansoor Nathani [mailto:man...@sy...]
> > > Sent: Friday, November 09, 2001 3:46 PM
> > > To: Dev users
> > > Subject: [Dev-C++] Efficiency
> > >
> > >
> > > Can any one please show me how to increase the efficiency of this
> > > recursive program?
> > >
> > > THe program is supposed to output the fibonacci sequence
> up to a given
> > > value.
> > >
> > > I need it to output in the middle of the recursive function, but
> > > a lot of garbage gets acumulated.
> > >
> > > Any help would be appreciated.
> > >
> > > Thanks
> > >
> > > Mansoor
> > >
> > >
> > > #include <iostream.h>
> > > int fib(int z);
> > >
> > > void main(void)
> > > {
> > > int c;
> > > for (int abc=0;abc<10;abc++)
> > > cout<<fib(abc)<<endl;
> > > cin>>c;
> > > }
> > >
> > > int fib(int z)
> > > {
> > > if (z==-1)
> > > return 1;
> > > if (z==-2)
> > > return 0;
> > > else
> > > return (fib(z-1)+fib(z-2));
> > > }
> > >
> > > _______________________________________________
> > > Dev-cpp-users mailing list
> > > Dev...@li...
> > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> > >
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
>
>
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: St0fF 6. <st...@gm...> - 2001-11-13 12:24:17
|
HI!
Recursive functions normally need a lot more time -> wanna speed it up -
ITERATE (do it in one for() / while() construct using only ONE FUNCTION
CALL).
maybe I'll get it right:
int fibonacci_iterated(int max) {
if (max<0) {return 0;}
else {/*register*/ int n=0, m=1,o=1;
for(int i=0;i<=max;i++) {
m+=n; n=o; o=m;}
return o;}
}
I mean, if you use C then use it right! I know some functions are very easy
coded recursively,
but this implies a lot of stacking and jumping around, and therefore it
needs a lot of extra - calling - time. So if a recursive function should
get speeded up, you have to count upwards instead of downwards. You need to
iterate instead of recursing (, and btw. you need more variables ...).
Hope this helps,
St0fF.
----- Original Message -----
From: "Williams, Timothy W." <TIM...@sa...>
To: "'Mansoor Nathani'" <man...@sy...>; "Dev users"
<dev...@li...>
Sent: Friday, November 09, 2001 10:11 PM
Subject: RE: [Dev-C++] Efficiency
> #include <iostream.h>
> #include <stdlib.h>
> int fib(int z);
> int fib_iter(int a, int b, int count);
>
> void main(void)
> {
> int n;
> cout << "Enter n:\n";
> cin >> n;
> cout << "My Way...\n";
> cout << fib_iter(1, 0, n);
> cout << "\n and now your way...\n";
> cout << fib(n);
>
> }
>
>
> int fib_iter(int a, int b, int count)
> {
> if (count == 0)
> return 1;
> else
> return a+fib_iter(a+b, a, count-1);
>
> }
> int fib(int z)
> {
> if (z==-1)
> return 1;
> if (z==-2)
> return 0;
> else
> return (fib(z-1)+fib(z-2));
> }
>
>
> > -----Original Message-----
> > From: Mansoor Nathani [mailto:man...@sy...]
> > Sent: Friday, November 09, 2001 3:46 PM
> > To: Dev users
> > Subject: [Dev-C++] Efficiency
> >
> >
> > Can any one please show me how to increase the efficiency of this
> > recursive program?
> >
> > THe program is supposed to output the fibonacci sequence up to a given
> > value.
> >
> > I need it to output in the middle of the recursive function, but
> > a lot of garbage gets acumulated.
> >
> > Any help would be appreciated.
> >
> > Thanks
> >
> > Mansoor
> >
> >
> > #include <iostream.h>
> > int fib(int z);
> >
> > void main(void)
> > {
> > int c;
> > for (int abc=0;abc<10;abc++)
> > cout<<fib(abc)<<endl;
> > cin>>c;
> > }
> >
> > int fib(int z)
> > {
> > if (z==-1)
> > return 1;
> > if (z==-2)
> > return 0;
> > else
> > return (fib(z-1)+fib(z-2));
> > }
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: <Cuo...@ao...> - 2001-11-13 03:17:19
|
Hello!!!
I wonder if you could show me how to executes the attached program by using
in the command line method/way on using Microsoft Visual C++ or Dev C++
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
//----------------------------------------------------------------------------
----
// array passed as pointer
float sum_array( float *A, int len )
{
float s = 0;
for( int i = 0; i < len; ++i )
s += A[i];
return s;
}
// array passed as array of unspecified length
float average_array( float A[], int len )
{
return sum_array( A, len )/len;
}
//----------------------------------------------------------------------------
----
void main( int argc, char **argv )
{
if( argc != 1 )
{
cerr << "Usage: " << argv[0] << " number" << endl;
cerr <<"int argc: "<<argc;
getchar();
exit(0);
}
int n = atoi( argv[1] );
float H[n];
for( int i = 1; i <= n; ++i )
H[i-1] = 1/float(i);
cout << "harmonic number " << n << ": " << sum_array( H, n ) << endl;
cout << "average 1/i up to " << n << ": " << average_array( H, n ) <<
endl;
exit(0);
}
//----------------------------------------------------------------------------
----
|
|
From: colin <lap...@ep...> - 2001-11-12 11:19:05
|
Hello, Dev-C++ version 5 is progressing nicely. You can already take a look at its current new features on the CVS (http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dev-cpp/) Download devcpp.exe and lang/english.lng enjoy your test and please give feedback ;) Colin |
|
From: Lorenzo <co...@in...> - 2001-11-12 08:58:03
|
> i want it can load big text size (if i use edit controls /API, it's > limited), have syntax coloring. try to use richedit control. ---------------------------------------------------------------------------- --- If debugging is the process of removing bugs, then programming must be the process of putting them in. ---------------------------------------------------------------------------- --- |
|
From: t54n1 <t5...@ya...> - 2001-11-12 08:25:27
|
dear all, i'm new to Dev-C++ (specially in C/C++). i've interest to build a text editor (for practicing) and i need your help (thank fro helping me :)) i want it can load big text size (if i use edit controls /API, it's limited), have syntax coloring. please guide me, or you can show me where i found a good tutorials that have relation. sorry for my bad english. thank all. 3LB45 |
|
From: Alex <sum...@be...> - 2001-11-12 05:07:38
|
|
From: Alex <sum...@be...> - 2001-11-12 05:06:37
|
|
From: chromatonus 7. <chr...@ho...> - 2001-11-12 04:30:14
|
i just can't get much out of my teacher's instruction. thanks! _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |
|
From: Jason H. <jas...@bt...> - 2001-11-12 01:39:00
|
The project option is probably disabled because you are editing a C or CPP
file, but didn't open a project for it. To enable project options you will
need to create a new project and add the file you want to it.
Also because you keep asking for a gotoxy() function and a clrscr() function
I have created them for you. There are limitations to these functions. You
have to be in a Windows console for them to work, which if you are using
Dev-C++ console mode you will be, and you have to include <windows.h>. You
may need to link the kernel32.lib (libkernel32.a), but it seems to work
without so it must be automatic, do it if you get a linker error for the
program.
Here is the code, I have made it so that you don't need to worry about
adding anything other than these two functions (and #include <windows.h>),
although I would have prefered to keep copy of the HANDLE hconsoleout as a
global, rather than regetting it for each call.
#include <windows.h>
#include <cstdlib>
#include <iostream>
inline void gotoxy(int x, int y);
inline void clrscr();
int main (int argc, char *argv[])
{
cout << "Hello";
gotoxy(25, 10);
cout << "World!";
gotoxy(50, 5);
cout << "I'm Here";
gotoxy(0,20);
system("PAUSE");
clrscr();
cout << "Hello World" << endl;
system("PAUSE");
return 0;
}
inline void gotoxy(int x, int y)
{
HANDLE hconsoleout;
hconsoleout = GetStdHandle(STD_OUTPUT_HANDLE);
COORD XY = {x, y};
SetConsoleCursorPosition(hconsoleout, XY);
}
inline void clrscr()
{
HANDLE hconsoleout;
hconsoleout = GetStdHandle(STD_OUTPUT_HANDLE);
COORD XY = {0, 0};
DWORD temp;
FillConsoleOutputCharacter(hconsoleout, ' ', 80*25, XY, &temp);
gotoxy(0,0); // goto topleft corner
}
If you have any problems with them just e-mail me and I'll see if I can sort
it out. Note that a normal console window is 80 by 25 in size, but can
sometimes be different, but I haven't acounted for that in clrscr(). And I
don't know what will happen if you try to use a coordinate outside that in
gotoxy(). One more thing, I'm not sure what will happen if you try these
when not in console mode, but it's probably you it will crash as I haven't
checked if the handle is valid. I'm not trying to scare you and it works
fine for me so I wouldn't worry too much.
Jason.
PS: it took me ages to find a function that would get the handle I needed.
----- Original Message -----
From: "chromatonus 712" <chr...@ho...>
To: <dev...@li...>
Sent: Sunday, November 11, 2001 9:56 PM
Subject: [Dev-C++] how do you use clrscr() and gotoxy() in Dev?
> please help...the project option in the toolbar is disabled and i don't
know
> how to use those functions even after i included conio.h in the
> headers...thanks!
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Ioannis V. <no...@ya...> - 2001-11-12 00:53:58
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf Of I.Ali > Sent: Monday, November 12, 2001 2:25 AM > To: dev...@li... > Subject: [Dev-C++] C++ >=20 >=20 > Hi All, >=20 > I am new to programming and decided that I would > either learn Java or C++, I went with C++ as this is > in greater demand and is a more powerful and popoular > langauge than Java, (and pays more too!). >=20 > Have I done the right thing in beginning to learn C++? Yes. Then it will be far easier to learn Java if you manage to learn the whole C++. :) > Also can anyone recommend the best way to learn C++? Books. Begin with "Accelerated C++" by Andrew Koenig, Barbara Moo. Keep in mind that since C++ is the best high level programming language it will be tough. Operating Systems are written with C++ (or C). :) Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys |