dev-cpp-users Mailing List for Dev-C++
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
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1
(18) |
2
(3) |
3
(5) |
4
(10) |
5
(2) |
6
(15) |
7
(10) |
8
(17) |
9
(28) |
10
(9) |
11
(20) |
12
(27) |
13
(16) |
14
(2) |
15
(5) |
16
(11) |
17
(6) |
18
(10) |
19
(21) |
20
(24) |
21
(15) |
22
(13) |
23
(26) |
24
(8) |
25
(9) |
26
(11) |
27
(13) |
28
(3) |
29
(4) |
30
(26) |
|
|
|
|
|
From: Ioannis V. <iv...@em...> - 2003-06-07 23:32:13
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Socha, David F > Sent: Saturday, June 07, 2003 2:35 PM > To: Dev C++ Mailing List > Subject: [Dev-C++] Constructors for classes >=20 > node* root =3D new node(5); >=20 > that should alocate the memory, call the constructor, and set=20 > the data portion of the node to 5. > the constructor that is called is the one that will assign a=20 > value to data not the default constructor that does nothing, right? No, it is not the default constructor. There are two types of "default constructors". The default constuctor = and the default copy constructor. If you define them, the defined ones get called. There is no other type of "default constructor" so if you had = not defined the one getting the int, you would get an error. The other default thing is the default assign operator (that is =3D). = Both the default copy constructor and the default assign operator copy the exact = data member values. When defined, the defined ones get called. Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
From: Ioannis V. <iv...@em...> - 2003-06-07 23:32:08
|
I have sent a few emails to Colin Laplace 1-2 weeks ago and I have not received any answer. Has anyone communicated with Colin lately? Regards, Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
From: Per W. <pw...@ia...> - 2003-06-07 19:43:00
|
The slstore() function DOES need it's last line, or else the list will not get a pointer to the last element. The pointer to the last element is used to allow insert of new elements last, without having to iterate throught the list. I know it's a bit extra noisy with dual indirection, but since the code is C and not C++, slstore() can't take references to pointers. /Per W On Sat, 7 Jun 2003, Ioannis Vranos wrote: > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...] On Behalf > > Of Andr? Macario Barros > > Sent: Friday, June 06, 2003 3:16 PM > > To: Dev-Cpp-Users > > Subject: [Dev-C++] Single Linked List-IV > > > > > > Dear users, > > Please consider this (modificated) Single Linked List Code: > > > > > > #include <stdio.h> > > #include <stdlib.h> > > > > #define MAX 5 > > > > struct address > > { > > char name[40]; > > char phone[20]; > > struct address *next; > > }; > > > > void slstore(struct address *, struct address **, struct address **); > > void display(struct address *); > > void list(struct address **); > > void init(struct address **); > > > > int main() > > { > > struct address *info=3DNULL, *start=3DNULL, *last=3DNULL; > > int i; > > > > for(i=3D0; i<MAX; i++) > > { > > init(&info); > > printf("Enter name: "); > > gets(info->name); > > > Dangerous, you can't expect the user to know the internals of your code a= nd > limit himself to 39 characters. Use fgets() instead. Avoid gets() in > general. > > fgets(info->name, 40, stdin); > > > > printf("Entre com phone: "); > > gets(info->phone); > > > fgets(info->phone, 20, stdin); > > > > slstore(info, &start, &last); > > } > > printf("List Recorded:\n"); > > list(&start); > > while (start) > > { > > info =3D start; > > start =3D start->next; > > free(info); > > } > > system("PAUSE"); > > return(0); > > } > > > > void slstore(struct address *i, struct address **start_arg, > > struct address **last_arg) > > { > > if(*last_arg=3D=3DNULL) > *start_arg=3Di; > > else > (*last_arg)->next=3Di; > > > i->next=3DNULL; > > *last_arg=3Di; > > } > > > I made the above more readable so as to understand it. Why do you use str= uct > **s and not struct *s and avoid those *s? > > I cannot understand the last line, it seems to contradict with the else > statement at least. I suspect a bug here. Ommiting the last line it becom= es: > > void slstore(struct address *i, struct address *start_arg, > struct address *last_arg) > { > if(last_arg=3D=3DNULL) > start_arg=3Di; > > else > last_arg->next=3Di; > > i->next=3DNULL; > } > > > > > > > void display(struct address *info) > > { > > printf("Actual address-->%p\n", info); > > When you pass a different pointer than expected in a variadic function yo= u > must cast: > > printf("Actual address-->%p\n", (void *)info); > > > > > > printf("%s\n", info->name); > > printf("%s\n", info->phone); > > printf("Next address-->%p\n", info->next); > > > printf("Next address-->%p\n", (void *) info->next); > > > > printf("\n"); > > system("PAUSE"); > > } > > > > void list(struct address **start_arg) > > { > > struct address *info; > > > > init(&info); > > info =3D *start_arg; > > while(info) > > { > > display(info); > > info =3D info->next; > > } > > } > > > You use **s while they are not needed in the whole program. > > > > > > void init(struct address **arg) > > { > > *arg=3D malloc(1*sizeof(struct address)); > > if(!(*arg)) > > { > > printf("sem mem=F3ria\n"); > > system("PAUSE"); > > exit(EXIT_FAILURE); > > } > > } > > > The same here. Without **s: > > > void init(struct address *arg) > { > arg=3D malloc(sizeof(*arg)); > > if(!arg) > { > printf("He was a good man, always to remember him\n"); > system("PAUSE"); > exit(EXIT_FAILURE); > } > } > > > > =3D=3D>My questions: > > A) One example of addresses that are printed on the screen are: > > 002224C8 > > 00222510 > > 00222558 > > 002225A0 > > 002225E8 > > The distance between theese addresses is 72 bytes, not 64 > > as expected > > because the size of the struct address. > > WHY? > > > > If I recall correctly you create them on the free store, so their address > can be anywhere. > > > > > > > > > B) Could the final loop: > > while (start) > > { > > info =3D start; > > start =3D start->next; > > free(info); > > } > > be changed by a function call for a function like > > > > free_ptr(&start); > > > > void free_ptr(struct address **arg) > > { > > struct address *info=3DNULL; > > > > while (*arg) > > { > > info =3D *arg; > > *arg =3D (*arg)->next; > > free(info); > > } > > } > > > Yes, isn't it exactly the same with the unneeded use of **s? Better: > > > void free_ptr(struct address *arg) > { > struct address *info; > > while (arg) > { > info =3D arg; > arg =3D arg->next; > free(info); > } > } > > > > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of TotalView, The best > thread debugger on the planet. Designed with thread debugging features > you've never dreamed of, try TotalView 6 free at www.etnus.com. > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
From: todd b. <tb...@nw...> - 2003-06-07 16:38:33
|
Hiya, I wanted to use the ncurses lib inorder to get the clrscr() = functionality like in conio. I am not sure what I should be downloading = (I see a lot of linux talk) or how to install, or even if I already have = it with dev-c 4.9.8. I appreciate anything to point me in the right = direction!=20 Thanks |
From: <or...@vp...> - 2003-06-07 12:39:04
|
Socha, David F wrote: > if i use this code later on in a program and create a new node dynamically using code such as: > > node* root = new node(5); > > that should alocate the memory, call the constructor, and set the data portion of the node to 5. > > the constructor that is called is the one that will assign a value to data not the default constructor that does nothing, right? Of course. If the compiler does not complain, then it found a matching overloaded function (constructor). It would give an error, if it cannot find a matching function. Try node *root = new node(5,5); to see, what error would you get. Anyway, why don't you use built-in C++ storage? It already has vectors, lists, etc. -- Greetings, Balázs |
From: Socha, D. F <dav...@us...> - 2003-06-07 11:39:48
|
If I had a node class (such as would be used in a linked list or a = binary search tree) as such: =20 class node{ public: =20 int data; //contains the data stored in the node =20 node* next; //pointer to the next node =20 node(){ //default constructor } =20 node(int insData){ //constructor that accepts parameters data =3D insData; } =20 ~node(){ //destructor } }; =20 if i use this code later on in a program and create a new node = dynamically using code such as: node* root =3D new node(5); that should alocate the memory, call the constructor, and set the data = portion of the node to 5. =20 the constructor that is called is the one that will assign a value to = data not the default constructor that does nothing, right? =20 Thanks for all of your help, David Socha |
From: Ioannis V. <iv...@em...> - 2003-06-07 10:58:53
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Andr? Macario Barros > Sent: Friday, June 06, 2003 3:16 PM > To: Dev-Cpp-Users > Subject: [Dev-C++] Single Linked List-IV >=20 >=20 > Dear users, > Please consider this (modificated) Single Linked List Code: >=20 >=20 > #include <stdio.h> > #include <stdlib.h> >=20 > #define MAX 5 >=20 > struct address > { > char name[40]; > char phone[20]; > struct address *next; > }; >=20 > void slstore(struct address *, struct address **, struct address **); > void display(struct address *); > void list(struct address **); > void init(struct address **); >=20 > int main() > { > struct address *info=3DNULL, *start=3DNULL, *last=3DNULL; > int i; >=20 > for(i=3D0; i<MAX; i++) > { > init(&info); > printf("Enter name: "); > gets(info->name); Dangerous, you can't expect the user to know the internals of your code = and limit himself to 39 characters. Use fgets() instead. Avoid gets() in general. fgets(info->name, 40, stdin); > printf("Entre com phone: "); > gets(info->phone); fgets(info->phone, 20, stdin); > slstore(info, &start, &last); > } > printf("List Recorded:\n"); > list(&start); > while (start) > { > info =3D start; > start =3D start->next; > free(info); > } > system("PAUSE"); > return(0); > } >=20 > void slstore(struct address *i, struct address **start_arg, > struct address **last_arg) > { > if(*last_arg=3D=3DNULL) *start_arg=3Di; > else (*last_arg)->next=3Di; > i->next=3DNULL; > *last_arg=3Di; > } I made the above more readable so as to understand it. Why do you use = struct **s and not struct *s and avoid those *s? I cannot understand the last line, it seems to contradict with the else statement at least. I suspect a bug here. Ommiting the last line it = becomes: void slstore(struct address *i, struct address *start_arg, struct address *last_arg) { if(last_arg=3D=3DNULL)=20 start_arg=3Di; =20 else last_arg->next=3Di; =20 i->next=3DNULL; } >=20 > void display(struct address *info) > { > printf("Actual address-->%p\n", info); When you pass a different pointer than expected in a variadic function = you must cast: printf("Actual address-->%p\n", (void *)info); > printf("%s\n", info->name); > printf("%s\n", info->phone); > printf("Next address-->%p\n", info->next); printf("Next address-->%p\n", (void *) info->next); > printf("\n"); > system("PAUSE"); > } >=20 > void list(struct address **start_arg) > { > struct address *info; >=20 > init(&info); > info =3D *start_arg; > while(info) > { > display(info); > info =3D info->next; > } > } You use **s while they are not needed in the whole program. > void init(struct address **arg) > { > *arg=3D malloc(1*sizeof(struct address)); > if(!(*arg)) > { > printf("sem mem=F3ria\n"); > system("PAUSE"); > exit(EXIT_FAILURE); > } > } The same here. Without **s: void init(struct address *arg) { arg=3D malloc(sizeof(*arg)); if(!arg) { printf("He was a good man, always to remember him\n"); system("PAUSE"); exit(EXIT_FAILURE); } } > =3D=3D>My questions: > A) One example of addresses that are printed on the screen are: > 002224C8 > 00222510 > 00222558 > 002225A0 > 002225E8 > The distance between theese addresses is 72 bytes, not 64=20 > as expected > because the size of the struct address. > WHY? If I recall correctly you create them on the free store, so their = address can be anywhere. >=20 > B) Could the final loop: > while (start) > { > info =3D start; > start =3D start->next; > free(info); > } > be changed by a function call for a function like >=20 > free_ptr(&start); >=20 > void free_ptr(struct address **arg) > { > struct address *info=3DNULL; >=20 > while (*arg) > { > info =3D *arg; > *arg =3D (*arg)->next; > free(info); > } > } Yes, isn't it exactly the same with the unneeded use of **s? Better: void free_ptr(struct address *arg) { struct address *info; =20 while (arg) { info =3D arg; arg =3D arg->next; free(info); } } Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
From: Muhammad F. <mf...@ww...> - 2003-06-07 09:04:42
|
Hi, I am using Dev-Cpp 4.9.8.0 with GCC 3.2. I am trying to compile Hello World program of WxWindows (template included in dev-cpp) but it is giving me a lot of errors. 15--C:\Dev-Cpp\include\wx\wx.h-----In file included from C:/Dev-Cpp/include/wx/wx.h 5--C:\Dev-Cpp\MyStuff\wintest\main.cpp----from main.cpp 320--C:\Dev-Cpp\include\wx\defs.h----redeclaration of C++ built-in type `bool' 17--C:\Dev-Cpp\include\wx\debug.h----In file included from C:/Dev-Cpp/include/wx/debug.h 468--C:\Dev-Cpp\include\wx\defs.h----from C:/Dev-Cpp/include/wx/defs.h 15--C:\Dev-Cpp\include\wx\wx.h----from C:/Dev-Cpp/include/wx/wx.h 5--C:\Dev-Cpp\MyStuff\wintest\main.cpp----from main.cpp 6--C:\Dev-Cpp\include\wx\wxchar.h:429--#error "Please define string case-insensitive compare for your OS/compiler" ..... and a lot of same looking errors. Please guide me how to overcome these errors. Regards, Farhan -- Open WebMail Project (http://openwebmail.org) |
From: Luigi S. <gi...@li...> - 2003-06-07 04:24:18
|
On Thu, Jun 05, 2003 at 09:31:41PM -0400, JB Maust wrote: > Hello, > > I am trying to compile a modular program. Is there an order to this (i.e. if I'm using Borland C++ Compiler at the DOS command prompt I'd have to compile each file separately, but with Dev C++ 4 (an IDE) I'm not sure. > > When I try to compile the files separately, I get zero errors but zero bytes compiled ... what could be wrong? > > [...] > > -- > J.B. Hi J.B. With Dev-C++, to produce the binary file of an application whose source code spans more than one file, create a "Project" and add all the source files to it. At that point, you just have to build the project to have the binary produced. -- >> gisan >> |
From: Luigi S. <gi...@li...> - 2003-06-07 04:24:12
|
Hi Andre', IMHO, code below should be changed such that: - use of function "gets" is avoided (because it does not check if overflow occurs) - memory used for the nodes of the list should be deallocated - initialization of pointers START and LAST, before placing any element on the list, does not require them pointing to some allocated memory - if portable code is of interest, use of OS specific functions (such as Dos "PAUSE") should be avoided Item #1 is a warning that Gcc issues (if you enable warnings) Item #2 is the reason of your mail, I'll say something about it later Item #3 is a small detail you probably overlooked, see comments in code below Item #4 reflects my personal tastes Now back to your original question. Generally, a container (like a list) has functions that push elements (as the slstore you provide) as well as function that pop elements. Also there might be the need for a clean-up function, which would remove all items on the list when you no longer need the container (and haven't popped out all elements yet). In this case, you are concerned with cleaning up operations, a possible inteface to such a function, could be: void clean_up(struct address **start, struct address **last); A simple implementation could be: - while there is something on the list (that is, *START is not 0) - duplicate value of *START using a temporary pointer - update *START (so that it points to second element, which eventually may be 0, when there is only one element left on the list) - free memory pointed by the temporary pointer - update *LAST, setting it to 0, thus leaving the list in a consistent state I hope the above was of some help. -- >> gisan >> On Thu, Jun 05, 2003 at 10:58:18PM -0300, Andr? Mac?rio Barros wrote: > Dear Users, > > I need to discover a way to use the "free" command to correctly avoid 5 > records dinamically allocated in a simple Single Linked List program. > Here are some pieces of it: > > [...] > > int main() > { > > struct address *info, *start, *last; > > init(&start); /* here start is assigned some memory */ > start=NULL; /* throwing away the address, so can't free it anymore */ > init(&last); /* allocating memory for last */ > last=NULL; /* throwing away the address */ /* above 4 lines could be folded into one line, also avoiding the memory leaks related to them: start = last = 0; */ > for(i=0; i<MAX; i++) > { > init(&info); > printf("Enter name: "); > gets(info->name); /* should be avoided */ > printf("Enter phone: "); > gets(info->phone); /* should be avoided */ > slstore(info, &start, &last); > } > ... > system("PAUSE"); /* this makes your code non portable, also it is not needed, if you run console application from a console window */ > return(0); > } > > [...] |