dev-cpp-users Mailing List for Dev-C++ (Page 211)
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: Oliver R. <Dr_...@gm...> - 2004-06-04 06:11:41
|
Does anyone know, if it is possible to use mspgcc instead of gcc to create prograsms for microcontrollers via dev-cpp? Greetings Olli -- +++ Jetzt WLAN-Router für alle DSL-Einsteiger und Wechsler +++ GMX DSL-Powertarife zudem 3 Monate gratis* http://www.gmx.net/dsl |
|
From: Dmitry S. <si...@si...> - 2004-06-04 05:51:17
|
Hello dev-cpp-users. I must create dll with some OLE classes. Could I use DevC++ to do this? Or I must forget about DevC++ and use VC++? |
|
From: Dmitry S. <si...@si...> - 2004-06-04 04:36:03
|
Hello dev-cpp-users. I read about FOX Toolkit for GUI applications. Have anybody use it? What is the better to use of GTK+, wxWindows, FLTK and FOXToolkit ( resource usage, simplicity of programming, expansibility)? How could I install FOXToolkit DevPak? There is no possibility to do it from WebUpdate because there is no such package in the mirrors How could I add new mirrors to WebUpdate? |
|
From: Dmitry S. <si...@si...> - 2004-06-04 02:26:04
|
Hello all! How could I use cvs with devc++ |
|
From: <per...@ya...> - 2004-06-04 01:39:36
|
I have used the Dev-C++ just a little time.Today,I write a very simple program trying to how to use the Debuger.In this process,I find the the color of the breakpoint will turn to blue if I delete the sentence (1) in the main().This should indicate the program has runed to the breakpoint. But if I reserve the sentence (1),the breakpoint' color will not change even I press the keyboard to input a data and this phenomenon certainly show the program has not executed to the breakpoint.
How to use the Debuger If my program have the I/O function such as scanf()?I have read the help in Dev-C++,but its information is so few.I can't find my answer in its help.
---Thanks,
Bruce.J
Here is my test program:
/* ********************************************* */
#include <stdio.h>
void test(int i)
{
printf("Debuging, i = %d\n", i); /* put a breakpoint in this line */
}
main()
{
int i;
scanf("%d", &i); /* sentence (1) */
test(i);
system("PAUSE");
}
---------------------------------
Do You Yahoo!?
嫌邮箱太小?雅虎电邮自助扩容! |
|
From: Per W. <pw...@ia...> - 2004-06-03 20:15:00
|
It's a bit strange, because the inline functions should generate code placed in Common segments, and the linker should accept multiple definitions of symbols in Common segments as long as the Common blocks are identical. It's only with --warn-common that the linker should emit a warning for a symbol available in more than one Common block. /Per W On Thu, 3 Jun 2004, Siva Chandra wrote: > > Hello, > > --- Per Westermark <pw...@ia...> wrote: > > When you create a library, you are supposted to > > _link_ to the functions in > > the library. What use is a library if you are using > > inline functions? > > The library( I created a hypothetical situation, but I > was trying to build OpenCV) and the header file has > other non-inline functions too. This header comes > along with 100-odd C++ source files which define the > other non-inline functions declared in the header. So > I followed the normal procedure and compiled and ar'ed > them into a *.a file! > > Siva Chandra > > > > > > __________________________________ > Do you Yahoo!? > Friends. Fun. Try the all-new Yahoo! Messenger. > http://messenger.yahoo.com/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by the new InstallShield X. > >From Windows to Linux, servers to mobile, InstallShield X is the one > installation-authoring solution that does it all. Learn more and > evaluate today! http://www.installshield.com/Dev2Dev/0504 > _______________________________________________ > 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: Siva C. <siv...@ya...> - 2004-06-03 16:32:56
|
Hello, --- Per Westermark <pw...@ia...> wrote: > When you create a library, you are supposted to > _link_ to the functions in > the library. What use is a library if you are using > inline functions? The library( I created a hypothetical situation, but I was trying to build OpenCV) and the header file has other non-inline functions too. This header comes along with 100-odd C++ source files which define the other non-inline functions declared in the header. So I followed the normal procedure and compiled and ar'ed them into a *.a file! Siva Chandra __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |
|
From: Per W. <pw...@ia...> - 2004-06-03 16:23:06
|
When you create a library, you are supposted to _link_ to the functions in the library. What use is a library if you are using inline functions? Then you don't need a library but may just include the header file. /Per W On Thu, 3 Jun 2004, Siva Chandra wrote: > > Hello Scott, > > --- Scott Simontis <age...@co...> wrote: > > I think it is because you are putting the > > definitions in the .h file. > > Instead, it would be better to make x.h have only > > variable declarations, > > defines, and function prototypes, and an x.cpp file > > which has all the > > function definitions. > > But aren't inline functions supposed to be defined in > the header files itself?...!! > > ...if no, then how would the compiler know the > function definition to generate code in-line? > > /Siva Chandra > > > -----Original Message----- > > From: dev...@li... > > On Behalf Of Siva Chandra > > Subject: [Dev-C++] Still more linker problems... > > > > Hello, > > > > I am still trying to solve my linker problems. I am > > trying to do the following: > > > > 1. Build a static library; > > For this I use a header file say x.h. This header > > file > > contains few inline functions( and of-course their > > definitions). So I comfortably compile all the > > source > > files, then put them together as libx.a file. The > > going is great so far!! > > > > 2. Next I try to use this library in an application. > > So I create a source file and compile it. Its all > > too > > simple and I get an object file, say, appx.o. Note > > that I include the header x.h in my source file. > > > > 3. Now I try to link my object file appx.o with > > libx.a. > > Here is where I am stuck. The linker complains about > > all the inline functions defined in x.h to be > > multiple-ly defined. > > > > Can somebody please help me out in getting around > > this > > problem!! > > > > TIA, > > > > Siva Chandra > > > ------------------------------------------------------- > > PS :: The problem I am facing is while try to build > > OpenCV and its support libs. > > > ------------------------------------------------------- > > > > > > __________________________________ > Do you Yahoo!? > Friends. Fun. Try the all-new Yahoo! Messenger. > http://messenger.yahoo.com/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by the new InstallShield X. > >From Windows to Linux, servers to mobile, InstallShield X is the one > installation-authoring solution that does it all. Learn more and > evaluate today! http://www.installshield.com/Dev2Dev/0504 > _______________________________________________ > 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: Siva C. <siv...@ya...> - 2004-06-03 15:49:16
|
Hello Scott, --- Scott Simontis <age...@co...> wrote: > I think it is because you are putting the > definitions in the .h file. > Instead, it would be better to make x.h have only > variable declarations, > defines, and function prototypes, and an x.cpp file > which has all the > function definitions. But aren't inline functions supposed to be defined in the header files itself?...!! ...if no, then how would the compiler know the function definition to generate code in-line? /Siva Chandra > -----Original Message----- > From: dev...@li... > On Behalf Of Siva Chandra > Subject: [Dev-C++] Still more linker problems... > > Hello, > > I am still trying to solve my linker problems. I am > trying to do the following: > > 1. Build a static library; > For this I use a header file say x.h. This header > file > contains few inline functions( and of-course their > definitions). So I comfortably compile all the > source > files, then put them together as libx.a file. The > going is great so far!! > > 2. Next I try to use this library in an application. > So I create a source file and compile it. Its all > too > simple and I get an object file, say, appx.o. Note > that I include the header x.h in my source file. > > 3. Now I try to link my object file appx.o with > libx.a. > Here is where I am stuck. The linker complains about > all the inline functions defined in x.h to be > multiple-ly defined. > > Can somebody please help me out in getting around > this > problem!! > > TIA, > > Siva Chandra > ------------------------------------------------------- > PS :: The problem I am facing is while try to build > OpenCV and its support libs. > ------------------------------------------------------- __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |
|
From: Scott S. <age...@co...> - 2004-06-03 14:48:09
|
Well, I don't think it really matters. If I have Microsoft Visual Studio available, I copy the OpenGL headers and everything into Dev-C++, but that's just preference, and some of it is because Dev-C++ doesn't come with GLaux if I ever need to use it. If there are standard headers and libs, go to Microsoft's web site and search for the OpenGL 1.1 developer stuff. It has GL.h, GLU.h, GLaux.h, ands their .lib and .dll libs. This is the official SGI 1.1 stuff, so this is probably what you are talking about. -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of michele Sent: Thursday, June 03, 2004 3:48 AM To: Per Westermark; DEV-C++ Subject: Re: [Dev-C++] profiler Yes, sorry ...I didn't know about the existence of gprof... One question... the gl files of dev-c++ are 'Mesa 3-D graphics library', it is right to use microsoft opengl32.dll or there is some 'specific' dll ? Thanks ----- Original Message ----- From: "Per Westermark" <pw...@ia...> To: "michele" <mic...@li...> Cc: "DEV-C++" <dev...@li...> Sent: Monday, May 31, 2004 5:11 PM Subject: Re: [Dev-C++] profiler > Isn't gprof - available with gcc - a good alternative? > > /Per W > > On Mon, 31 May 2004, michele wrote: > > > hello, > > Does someone know a good - free - profiler for dev-c++? > > Thanks. > > M. > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: Oracle 10g > > Get certified on the hottest thing ever to hit the market... Oracle 10g. > > Take an Oracle 10g class now, and we'll give you the exam FREE. > > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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 the new InstallShield X. From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ 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: Scott S. <age...@co...> - 2004-06-03 14:42:32
|
I think it is because you are putting the definitions in the .h file. Instead, it would be better to make x.h have only variable declarations, defines, and function prototypes, and an x.cpp file which has all the function definitions. What is happening is that the definitions are being held in the libx.a file and in the header, and thus the compiler doesn't know which definition to use. SO the choices here are to put all the definitions in an x.cpp file, or just use one big header for everything. -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Siva Chandra Sent: Thursday, June 03, 2004 7:15 AM To: dev...@li... Subject: [Dev-C++] Still more linker problems... Hello, I am still trying to solve my linker problems. I am trying to do the following: 1. Build a static library; For this I use a header file say x.h. This header file contains few inline functions( and of-course their definitions). So I comfortably compile all the source files, then put them together as libx.a file. The going is great so far!! 2. Next I try to use this library in an application. So I create a source file and compile it. Its all too simple and I get an object file, say, appx.o. Note that I include the header x.h in my source file. 3. Now I try to link my object file appx.o with libx.a. Here is where I am stuck. The linker complains about all the inline functions defined in x.h to be multiple-ly defined. Can somebody please help me out in getting around this problem!! TIA, Siva Chandra ------------------------------------------------------- PS :: The problem I am facing is while try to build OpenCV and its support libs. ------------------------------------------------------- __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ 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: Siva C. <siv...@ya...> - 2004-06-03 11:15:25
|
Hello, I am still trying to solve my linker problems. I am trying to do the following: 1. Build a static library; For this I use a header file say x.h. This header file contains few inline functions( and of-course their definitions). So I comfortably compile all the source files, then put them together as libx.a file. The going is great so far!! 2. Next I try to use this library in an application. So I create a source file and compile it. Its all too simple and I get an object file, say, appx.o. Note that I include the header x.h in my source file. 3. Now I try to link my object file appx.o with libx.a. Here is where I am stuck. The linker complains about all the inline functions defined in x.h to be multiple-ly defined. Can somebody please help me out in getting around this problem!! TIA, Siva Chandra ------------------------------------------------------- PS :: The problem I am facing is while try to build OpenCV and its support libs. ------------------------------------------------------- __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |
|
From: michele <mic...@li...> - 2004-06-03 07:53:23
|
Yes, sorry ...I didn't know about the existence of gprof... One question... the gl files of dev-c++ are 'Mesa 3-D graphics library', it is right to use microsoft opengl32.dll or there is some 'specific' dll ? Thanks ----- Original Message ----- From: "Per Westermark" <pw...@ia...> To: "michele" <mic...@li...> Cc: "DEV-C++" <dev...@li...> Sent: Monday, May 31, 2004 5:11 PM Subject: Re: [Dev-C++] profiler > Isn't gprof - available with gcc - a good alternative? > > /Per W > > On Mon, 31 May 2004, michele wrote: > > > hello, > > Does someone know a good - free - profiler for dev-c++? > > Thanks. > > M. > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: Oracle 10g > > Get certified on the hottest thing ever to hit the market... Oracle 10g. > > Take an Oracle 10g class now, and we'll give you the exam FREE. > > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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: Siva C. <siv...@ya...> - 2004-06-03 05:26:00
|
Hello Tim, Firstly, thanks a lot for the tip. > Just a small hint: > If you have some undefined references, this is > mostly because you have > forgotten to link against something. You can solve > this by grepping > through your lib directy. I use the search tool to search for files containing the text "whatever". In this case I got a result of 33 *.a files including the libgreta.a file which uses wctype(). So I thought, instead of trying out each of these libs I should be asking someone and may be save time. But alas I could'nt and I tried out each of those files and found that linking with libmsvcp60.a solves the problem!! Siva Chandra __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |
|
From: Per W. <pw...@ia...> - 2004-06-03 05:25:06
|
I haven't had the time to check all code, but there are a number of errors here. For some of them, see below: /Per W On Thu, 3 Jun 2004, [gb2312] Bruce jjs wrote: > > I have write a double chain list program that do only some simple ope= ration.But the result of the function DeleteList() is not natural.It will d= elete all the node before the ith node.I haven't found the reason of the pr= oblem by far.Can someone can me why and how to improve it? > > ---Thanks, > > Bruce.J > > My program is list belove: > > /* ************************************************************ */ > > #include <stdio.h> > > enum bool {FALSE, TRUE}; > typedef enum bool BOOL; > typedef int DATA; > typedef struct DoubleLink { > DATA data; > struct DoubleLink *prev; > struct DoubleLink *next; > } DoubleLink; > > /* Input the value of n entries element to create a double chain list */ > DoubleLink *CreateList(DoubleLink *p, int n) > { > DoubleLink *ptr; > int i; > ------ What are you using the parameter p for, since you immediately assigns your own value to it? Besides, when you call CreateList() from main(), you send in an undefined pointer. Maybe you thought of sending in a pointer to a pointer? ------ > p =3D (DoubleLink *) malloc(sizeof(DoubleLink)); > > /* First create a empty double chain list with a head pointer */ > p->next =3D NULL; > p->prev =3D NULL; > for (i =3D 0; i < n; ++i) { > ptr =3D (DoubleLink *) malloc(sizeof(DoubleLink)); > scanf("%d", &ptr->data); > ptr->prev =3D p; > ptr->next =3D p->next; > p->next =3D ptr; > } > return p; > } > > /* Get the length of the double chain list */ > int GetLength(DoubleLink *p) > { > DoubleLink *p1; > int i =3D 0; > > p1 =3D p->next; > while (p1) { > ++i; > p1 =3D p1->next; > } > return i; > } > > /* Delete the ith element */ > /* It has a problem that it will delete the all element which before the = ith element when I run it,but I don't know why.*/ > BOOL DeleteList(DoubleLink *p, int i) > { > if (i<1 || i>GetLength(p)) > return FALSE; > > DoubleLink *p1; > int j =3D 0; > > p1 =3D p; > while(p1 && j<i) { ------ Depending on i, this might loop until p1 =3D=3D NULL ------ > p1 =3D p1->next; > ++j; > } ------ And if p1 is NULL, you're not allowed to try p1->next ------ > if (p1->next =3D=3D NULL) ------ Let's say that p1->next is NULL. Then you still have to check if p1->prev is !=3D and in that case set p1->prev->next =3D NULL; since p1->prev will loose it's last entry. ------ > free(p1); /* If it is a last node,direct to free the memory */ > else { > p1->prev->next =3D p1->next; > p1->next->prev =3D p1->prev; > free(p1); > } > return TRUE; > } > > /* Printf the double chain list*/ > void OutputList(DoubleLink *p) > { > DoubleLink *p1; > > > p1 =3D p; > while (p1 =3D p1->next) > printf("%d,", p1->data); > printf("\n"); > } > > /* free the memory of double chain list If not to use it latter */ > void DestoryList(DoubleLink *p) > { > while (p) { ------ You can't first delete p, and then get p->next. You have to take a copy of p->next before calling free(p) ------ > free(p); > p =3D p->next; > } > } > > main() > { > DoubleLink *ptr; > int n, i; > > printf("Please input the number of data you want to create:\n"); > scanf("%d", &n); > ptr =3D CreateList(ptr, n); > OutputList(ptr); > > printf("Please input the ith where you want to delete:\n"); > scanf("%d", &i); > if (DeleteList(ptr, i)) { > printf("Delete success!\n"); > OutputList(ptr); > } else > printf("Delete failed!\n"); > DestoryList(ptr); > system("PAUSE"); > } > > > > > --------------------------------- > Do You Yahoo!? > =CF=D3=D3=CA=CF=E4=CC=AB=D0=A1=A3=BF=D1=C5=BB=A2=B5=E7=D3=CA=D7=D4=D6=FA= =C0=A9=C8=DD=A3=A1 |
|
From: <per...@ya...> - 2004-06-03 01:14:52
|
I have write a double chain list program that do only some simple operation.But the result of the function DeleteList() is not natural.It will delete all the node before the ith node.I haven't found the reason of the problem by far.Can someone can me why and how to improve it?
---Thanks,
Bruce.J
My program is list belove:
/* ************************************************************ */
#include <stdio.h>
enum bool {FALSE, TRUE};
typedef enum bool BOOL;
typedef int DATA;
typedef struct DoubleLink {
DATA data;
struct DoubleLink *prev;
struct DoubleLink *next;
} DoubleLink;
/* Input the value of n entries element to create a double chain list */
DoubleLink *CreateList(DoubleLink *p, int n)
{
DoubleLink *ptr;
int i;
p = (DoubleLink *) malloc(sizeof(DoubleLink));
/* First create a empty double chain list with a head pointer */
p->next = NULL;
p->prev = NULL;
for (i = 0; i < n; ++i) {
ptr = (DoubleLink *) malloc(sizeof(DoubleLink));
scanf("%d", &ptr->data);
ptr->prev = p;
ptr->next = p->next;
p->next = ptr;
}
return p;
}
/* Get the length of the double chain list */
int GetLength(DoubleLink *p)
{
DoubleLink *p1;
int i = 0;
p1 = p->next;
while (p1) {
++i;
p1 = p1->next;
}
return i;
}
/* Delete the ith element */
/* It has a problem that it will delete the all element which before the ith element when I run it,but I don't know why.*/
BOOL DeleteList(DoubleLink *p, int i)
{
if (i<1 || i>GetLength(p))
return FALSE;
DoubleLink *p1;
int j = 0;
p1 = p;
while(p1 && j<i) {
p1 = p1->next;
++j;
}
if (p1->next == NULL)
free(p1); /* If it is a last node,direct to free the memory */
else {
p1->prev->next = p1->next;
p1->next->prev = p1->prev;
free(p1);
}
return TRUE;
}
/* Printf the double chain list*/
void OutputList(DoubleLink *p)
{
DoubleLink *p1;
p1 = p;
while (p1 = p1->next)
printf("%d,", p1->data);
printf("\n");
}
/* free the memory of double chain list If not to use it latter */
void DestoryList(DoubleLink *p)
{
while (p) {
free(p);
p = p->next;
}
}
main()
{
DoubleLink *ptr;
int n, i;
printf("Please input the number of data you want to create:\n");
scanf("%d", &n);
ptr = CreateList(ptr, n);
OutputList(ptr);
printf("Please input the ith where you want to delete:\n");
scanf("%d", &i);
if (DeleteList(ptr, i)) {
printf("Delete success!\n");
OutputList(ptr);
} else
printf("Delete failed!\n");
DestoryList(ptr);
system("PAUSE");
}
---------------------------------
Do You Yahoo!?
嫌邮箱太小?雅虎电邮自助扩容! |
|
From: Per W. <pw...@ia...> - 2004-06-02 19:17:25
|
The compiler parameter list is when compiling source files -> object files. The linker parameter list is for linking objects + libraries into executable. /Per W On 2 Jun 2004, Philippe Parent wrote: > What's the difference between adding a lib file (ie libuser32.a) to the > linker parameter list VS. adding a -luser32 to the compiler parameter > list? > > Thanks, > P > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the new InstallShield X. > >From Windows to Linux, servers to mobile, InstallShield X is the one > installation-authoring solution that does it all. Learn more and > evaluate today! http://www.installshield.com/Dev2Dev/0504 > _______________________________________________ > 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: Philippe P. <pp...@un...> - 2004-06-02 19:06:46
|
What's the difference between adding a lib file (ie libuser32.a) to the linker parameter list VS. adding a -luser32 to the compiler parameter list? Thanks, P |
|
From: Jorge A. <jor...@ep...> - 2004-06-02 14:09:41
|
#include <stdlib.h>
Randy escribi=F3:
> This is the era I get what am I doing wrong
>
>
> implicit declaration of function `int rand(...)'
>
> #incude <stdio.h>
> =20
> main()
> {
> int target;
> int guess;
> int again;
> =20
>
> printf("\n Do you want to guess a number 1=3Dyes, 0=3Dno");
> scanf("%d",&again);
> =20
> while (again)
> {
> target=3Drand()%100;
> =20
> printf("\n What is your guess ? ");
> scanf("%d",&guess);
> =20
> while(target!=3Dguess)
> {
> if(target>guess)printf(" Too low ");
> else printf(" too high ");
> printf("\n What is your guess ? ");
> scanf("%d" ,&guess);
> }
> =20
> printf("\n Well done you got it! \n");
> printf("\n Do you want to guess a number 1=3Dyes, 0=3Dno");
> scanf("%d",&again);
> }
> }
|
|
From: Randy <hun...@be...> - 2004-06-02 12:58:55
|
This is the era I get what am I doing wrong
implicit declaration of function `int rand(...)'
#incude <stdio.h>
main()
{
int target;
int guess;
int again;
printf("\n Do you want to guess a number 1=3Dyes, 0=3Dno");
scanf("%d",&again);
while (again)
{
target=3Drand()%100;
printf("\n What is your guess ? ");
scanf("%d",&guess);
while(target!=3Dguess)
{
if(target>guess)printf(" Too low ");
else printf(" too high ");
printf("\n What is your guess ? ");
scanf("%d" ,&guess);
}
printf("\n Well done you got it! \n");
printf("\n Do you want to guess a number 1=3Dyes, 0=3Dno");
scanf("%d",&again);
}
}
|
|
From: Tim S. <ti...@we...> - 2004-06-02 11:10:59
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Siva, Siva Chandra wrote: | Here again it compiles fine but the linker gives two | undefined reference errors: | | 1. undefined reference to 'wctype' | 2. undefined reference to 'btowc' | Do I have to link some other libraries while I | compile? | If yes, which ones? yes, you need to link against 'libmsvcr70.a', just adding -lmsvcr70 to the linker flags schould be also ok. Just a small hint: If you have some undefined references, this is mostly because you have forgotten to link against something. You can solve this by grepping through your lib directy. For Example you want to find in which file the btowc function resides: 1. Open a command prompt (Under winnt-systems Start->run->cmd) 2. Change to your lib dirrectory (Its in your Dev-Cpp directory) 3. grep after your string, in our example you have to do 'grep btowc *' (If you don't have grep you can obtain it from http://gnuwin32.sourceforge.net/packages/grep.htm) Then all files which contains this string are listed. This method doesn't help all the time, but in most cases you'll find a ~ appropriate lib to link against. HTH Tim - -- http://we-are-the-b.org/~tim/borg.key -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFAvbVxsMXChvH2qP0RAsLKAJ97prpsKhfw1xkCXE3ILeQfIg5eJACdH/NM 0gN5MkOLrja0xwK0nIRLJUw= =tb7Q -----END PGP SIGNATURE----- |
|
From: Daniel K. O. <dan...@ya...> - 2004-06-02 09:52:33
|
Dmitry Sidorov wrote: >I want to use GTK+ package with DevC++ 4.9.8.7 >But both of the links in the download section on the page >http://bloodshed.net/dev/packages/gtk.html aren`t work :( > > Try reading this: http://www.polarhome.com/~danielko/gtk_win32_tutorial.html Daniel K. O. |
|
From: Dmitry S. <si...@si...> - 2004-06-02 08:02:10
|
Hello! I want to use GTK+ package with DevC++ 4.9.8.7 But both of the links in the download section on the page http://bloodshed.net/dev/packages/gtk.html aren`t work :( I downloaded DevEx (GTK Extension for Dev-C++) from http://wingtk.sourceforge.net/. When I ran it asked me to specify DevC++ path. When I specified it tell me there is no devc++ in that directory :( What can I do? Where can I find GTK+ package? There is no such package in WebUpdate module :( Another question is how can I upgrade my devc++ to 4.9.8.9? I tried to do it with WebUpdate module, but it said I must close devc++ window first. When I closed it, devc++ closed WebUpdate window too. And now I have DevC++ 4.9.8.7 and no DevC++ 4.9.8.9 in the list of availible updates in the WebUpdate :( |
|
From: Siva C. <siv...@ya...> - 2004-06-02 06:02:31
|
Hello all, I am trying to compile and test greta. It compiles fine. I downloaded a sample program and am trying to compile it. Here again it compiles fine but the linker gives two undefined reference errors: 1. undefined reference to 'wctype' 2. undefined reference to 'btowc' Do I have to link some other libraries while I compile? If yes, which ones? TIA Siva Chandra. __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ |
|
From: Jorge A. <jor...@ep...> - 2004-06-02 01:16:46
|
You have to allocate memory for the structure before allocate the array
inside.
Bruce jjs escribi=A8=AE:
> I have writed a simple program just only construct two empty linear
> list.The process of compile is no problem.But after run it,the system
> crash occur.If I remove the sentence (2),the problem will not come.Can
> anyone tell me how to do If I want to use the function InitList()
> separate to construct two empty list?
> Thanks,
> Bruce.J
> My program list below:
> /* A simple program that want to construct two empty linear list */
> #define LIST_INIT_SIZE 10
> typedef int ARRAY;
> typedef struct {
> ARRAY *elem; /* a pointer of one dimension array */
> int length; /*the linear list current length */
> int listsize; /* the linear list's space that has distributed */
> }LineList;
>
> /* construct a empty linear list */
> ARRAY *InitList(LineList *list)
> {
> list->elem =3D (ARRAY *) malloc(LIST_INIT_SIZE * sizeof(ARRAY));
> list->length =3D 0;
> list->listsize =3D LIST_INIT_SIZE;
> return list->elem;
> }
> main()
> {
> LineList *list, *list1;
>
> /* want to create two empty linear list */
> list->elem =3D InitList(list); /* sentence (1) */
> list1->elem =3D InitList(list1); /* sentence (2) */
> system("PAUSE");
> }
>
>
> -----------------------------------------------------------------------=
-
> *Do You Yahoo!?*
> =CF=D3=D3=CA=CF=E4=CC=AB=D0=A1=A3=BF=D1=C5=BB=A2=B5=E7=D3=CA=D7=D4=D6=FA=
=C0=A9=C8=DD=A3=A1
> <http://cn.rd.yahoo.com/mail_cn/tag/10m/*http://cn.mail.yahoo.com/event=
/10m.html>
|