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
(11) |
2
(8) |
3
(2) |
4
(13) |
5
(8) |
6
(16) |
7
(11) |
8
(5) |
9
(9) |
10
(13) |
11
(20) |
12
(10) |
13
(14) |
14
|
15
(3) |
16
(14) |
17
(10) |
18
(11) |
19
(5) |
20
(8) |
21
(7) |
22
(4) |
23
(11) |
24
|
25
(2) |
26
(4) |
27
(1) |
28
(5) |
29
(11) |
30
(6) |
|
From: Daniel G. <sp...@ho...> - 2001-11-10 23:52:49
|
<html><div style='background-color:'><DIV> <P>I got really annoyed with Borland's "freebie" that I changed my mind and went and bought microsoft's visual C++ compiler. That'll teach them!!!<BR><BR></P></DIV> <DIV></DIV> <DIV></DIV>>From: "chromatonus 712" <CHR...@HO...> <DIV></DIV>>To: dev...@li... <DIV></DIV>>Subject: [Dev-C++] how do you install Borland free compiler? <DIV></DIV>>Date: Sat, 10 Nov 2001 23:45:07 +0000 <DIV></DIV>> <DIV></DIV>>hi, i couldn't make of these procedures after i opened <DIV></DIV>>freecommandlinetools.exe <DIV></DIV>>downloaded from CNET <DIV></DIV>>please help, thanks <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>2. From the bin directory of your installation: <DIV></DIV>> a. Add "c:\Borland\Bcc55" <DIV></DIV>> to the existing path <DIV></DIV>> b. Create a bcc32.cfg file which will set <DIV></DIV>> the compiler options for the Include <DIV></DIV>> and Lib paths (-I and -L switches to <DIV></DIV>> compiler) by adding these lines: <DIV></DIV>> -I"c:\Borland\Bcc55\include" <DIV></DIV>> -L"c:\Borland\Bcc55\lib" <DIV></DIV>> c. Create an ilink32.cfg file which will set <DIV></DIV>> the linker option for the Lib path by <DIV></DIV>> adding this line: <DIV></DIV>> -L"c:\Borland\Bcc55\lib" <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>_________________________________________________________________ <DIV></DIV>>Get your FREE download of MSN Explorer at <DIV></DIV>>http://explorer.msn.com/intl.asp <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>_______________________________________________ <DIV></DIV>>Dev-cpp-users mailing list <DIV></DIV>>Dev...@li... <DIV></DIV>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html> |
From: chromatonus 7. <chr...@ho...> - 2001-11-10 23:45:21
|
hi, i couldn't make of these procedures after i opened freecommandlinetools.exe downloaded from CNET please help, thanks 2. From the bin directory of your installation: a. Add "c:\Borland\Bcc55" to the existing path b. Create a bcc32.cfg file which will set the compiler options for the Include and Lib paths (-I and -L switches to compiler) by adding these lines: -I"c:\Borland\Bcc55\include" -L"c:\Borland\Bcc55\lib" c. Create an ilink32.cfg file which will set the linker option for the Lib path by adding this line: -L"c:\Borland\Bcc55\lib" _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |
From: Jason H. <jas...@bt...> - 2001-11-10 21:15:19
|
No offence, but I'm having trouble working through your english. From what I can gather you have a file which you need to read through and re-output in a different format. If you could provide an example of a valid input file (3 or 4 lines) and the output file that it would convert to. You don't have to provide actual data, just make it up if it's confidential. Maybe then we could work up something that might work. I don't know of any standard functions that determine for you whether something is a float, int or string of somesort. It is assumed you would know the file format or be able to work it out for yourself. It depends upon how you choose to represent your data in the end. I am currently working on a program that takes in a file and outputs something else depending upon the contents of the input file. So all that needs to be different is the code that deciphers the input and produces the output. Also Dev-C++ is just an environment for developing programs, the standard compiler is MinGW, which isn't totally standards compliant but works well enough. Jason. ----- Original Message ----- From: "carlos GARCÍA DEL MONTE" <cg...@wo...> To: <dev...@li...> Sent: Saturday, November 10, 2001 6:00 PM Subject: [Dev-C++] [Dec-C++]eof() function and type variable from file input > Hi again: > > I am writing a program for make a two weeks work in one minute, and it > will take me two months... > I have a .txt archive with various tables of diferent amount of rows, > and always five columns; I need a program which the first five data are > sent to a char * variable; the next 5*n values to a float [5] and write > them in other archive as I need them, after one data which is char *, > made by letters and numbers, being the first a letter. > > Well: I try it writing what I must write but: > a) If I use while(!inputFile.eof()){ > the body of all the instructions needed > } > When I run the program, immediately, > when it's the moment of reading the inputFile **the program has > generated an error log and it wwill be closed by windows** > b) If I try something like for(as many times as tables it must > pass) I find that it doesn't recognize the type of the data: > The first is a while(inputFile >> charvariable); what i want do with > them; while(inputFile >> floatvariable); what I want do with them, with > the correspondent variable arrays with the suscripts and counters, etc; > and inputFile >> thelastcharofthetable);what I want do; Then I found the > program: > b.1) ***generated error.log bla bla guauau**** > b.2) It considered all data as char, and soit did for every data of > the txt file the same, what I want for the first five words. > > Are there any function hich lets the program know if the data from input > file is float or char or int and once known use that data for the > correct instruction? Or it is best to do it by hand, killing the > computer and suiciding myself? > > I hope this is a problem for be console program, so I will be able to > write the program I think i will need write in the future. But I think, > that although the main are the windows programs, the console ones would > be good to have a good work. > Now I don't need that hard program and it would be very, very useful can > program some little consoles. And if I can write the program five > minutes and do what I need in three seconds (I don't worry very much now > about efficiency, I write for myself) and avoid do it by hand in weeks > of giant boring waste of time. > > Thanks to anybody who can help. > Thanks to everybody who will find this message occupying memory, for > their patience. > Thanks if Dev-C++ 5 solve this problems(if it is really a problem of the > progran and not my inexperience) (And thanks either if not). > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
From: Jason H. <jas...@bt...> - 2001-11-10 20:48:58
|
There is a way of doing it. Create a Dev-C++ project and call it = whatever, but not the name you actualy want it to be. Then add the = source file or files you want to it, and save it all. Then you can exit = Dev-C++ (or just close the project) and go to the project file and = rename it to what you want, and restart dev-C++ and load in the renamed = project. You may also want to go into project->options and change the = project name there. It should all still work, and to be honest I can see = no reason why it would prevent you from doing it this way in the first = place. I can understand why some other files cannot have same names, but = the project file isn't one. Maybe in future version this restriction will be removed. (please?) Jason. ----- Original Message -----=20 From: Daniel Glenfield=20 To: dev...@li...=20 Sent: Saturday, November 10, 2001 5:04 PM Subject: Re: [Dev-C++] Re: Welcome to the "Dev-cpp-users" mailing list I always use names like Simple for the project then simple_file1.c I = found that works better :) not sure how to sort it so both can be the same name though. >From: David Aliaga=20 >To: dev...@li...=20 >Subject: [Dev-C++] Re: Welcome to the "Dev-cpp-users" mailing list=20 >Date: Sat, 10 Nov 2001 08:42:14 -0800 (PST)=20 >=20 >Hi!=20 >=20 >This is my first post here=20 >Just a very basic question, Today is my first time=20 >using DevC++ and I want to make a project lets call it=20 >ProA which contains a file ProA.c The program tells me=20 >it is not allowed to add c files with the same name as=20 >the project BUT I have some examples where this is=20 >allowed.=20 >=20 >How can I make a project "simple" with a file=20 >"simple.c" in it. I am sorry but the help of the=20 >program is not clear at all!!=20 >=20 >Dave=20 >=20 >__________________________________________________=20 >Do You Yahoo!?=20 >Find a job, post your resume.=20 >http://careers.yahoo.com=20 >=20 >_______________________________________________=20 >Dev-cpp-users mailing list=20 >Dev...@li...=20 >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users=20 -------------------------------------------------------------------------= ----- Get your FREE download of MSN Explorer at http://explorer.msn.com _______________________________________________ Dev-cpp-users mailing = list Dev...@li... = https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
From: carlos D. M. <cg...@wo...> - 2001-11-10 17:58:28
|
Hi again: I am writing a program for make a two weeks work in one minute, and it will take me two months... I have a .txt archive with various tables of diferent amount of rows, and always five columns; I need a program which the first five data are sent to a char * variable; the next 5*n values to a float [5] and write them in other archive as I need them, after one data which is char *, made by letters and numbers, being the first a letter. Well: I try it writing what I must write but: a) If I use while(!inputFile.eof()){ the body of all the instructions needed } When I run the program, immediately, when it's the moment of reading the inputFile **the program has generated an error log and it wwill be closed by windows** b) If I try something like for(as many times as tables it must pass) I find that it doesn't recognize the type of the data: The first is a while(inputFile >> charvariable); what i want do with them; while(inputFile >> floatvariable); what I want do with them, with the correspondent variable arrays with the suscripts and counters, etc; and inputFile >> thelastcharofthetable);what I want do; Then I found the program: b.1) ***generated error.log bla bla guauau**** b.2) It considered all data as char, and soit did for every data of the txt file the same, what I want for the first five words. Are there any function hich lets the program know if the data from input file is float or char or int and once known use that data for the correct instruction? Or it is best to do it by hand, killing the computer and suiciding myself? I hope this is a problem for be console program, so I will be able to write the program I think i will need write in the future. But I think, that although the main are the windows programs, the console ones would be good to have a good work. Now I don't need that hard program and it would be very, very useful can program some little consoles. And if I can write the program five minutes and do what I need in three seconds (I don't worry very much now about efficiency, I write for myself) and avoid do it by hand in weeks of giant boring waste of time. Thanks to anybody who can help. Thanks to everybody who will find this message occupying memory, for their patience. Thanks if Dev-C++ 5 solve this problems(if it is really a problem of the progran and not my inexperience) (And thanks either if not). |
From: Daniel G. <sp...@ho...> - 2001-11-10 17:04:51
|
<html><div style='background-color:'><DIV> <P>I always use names like Simple for the project then simple_file1.c I found that works better :)</P> <P>not sure how to sort it so both can be the same name though.<BR><BR></P></DIV> <DIV></DIV> <DIV></DIV>>From: David Aliaga <KYO...@YA...> <DIV></DIV>>To: dev...@li... <DIV></DIV>>Subject: [Dev-C++] Re: Welcome to the "Dev-cpp-users" mailing list <DIV></DIV>>Date: Sat, 10 Nov 2001 08:42:14 -0800 (PST) <DIV></DIV>> <DIV></DIV>>Hi! <DIV></DIV>> <DIV></DIV>>This is my first post here <DIV></DIV>>Just a very basic question, Today is my first time <DIV></DIV>>using DevC++ and I want to make a project lets call it <DIV></DIV>>ProA which contains a file ProA.c The program tells me <DIV></DIV>>it is not allowed to add c files with the same name as <DIV></DIV>>the project BUT I have some examples where this is <DIV></DIV>>allowed. <DIV></DIV>> <DIV></DIV>>How can I make a project "simple" with a file <DIV></DIV>>"simple.c" in it. I am sorry but the help of the <DIV></DIV>>program is not clear at all!! <DIV></DIV>> <DIV></DIV>>Dave <DIV></DIV>> <DIV></DIV>>__________________________________________________ <DIV></DIV>>Do You Yahoo!? <DIV></DIV>>Find a job, post your resume. <DIV></DIV>>http://careers.yahoo.com <DIV></DIV>> <DIV></DIV>>_______________________________________________ <DIV></DIV>>Dev-cpp-users mailing list <DIV></DIV>>Dev...@li... <DIV></DIV>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html> |
From: David A. <kyo...@ya...> - 2001-11-10 16:42:16
|
Hi! This is my first post here Just a very basic question, Today is my first time using DevC++ and I want to make a project lets call it ProA which contains a file ProA.c The program tells me it is not allowed to add c files with the same name as the project BUT I have some examples where this is allowed. How can I make a project "simple" with a file "simple.c" in it. I am sorry but the help of the program is not clear at all!! Dave __________________________________________________ Do You Yahoo!? Find a job, post your resume. http://careers.yahoo.com |
From: Ioannis V. <no...@ya...> - 2001-11-10 15:44:54
|
And how do you think we can do that? =20 =20 Ioannis =20 * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/>=20 * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Jennifer Dreussi Sent: Saturday, November 10, 2001 6:59 AM To: dev...@li... Subject: [Dev-C++] unsubscribe Please unsubscribe me. Thanks. |
From: Jason H. <jas...@bt...> - 2001-11-10 02:26:03
|
The main reason was to avoid the use of *&, I personally believe that = using reference to a pointer, in main(), is a bad way of doing things. = Using a container (I believe) is representative of better design, = although it does look silly in the case of it containing only one = member. I find it easier to deal with the list that way, and by using = abstraction and such you can help avoid coding errors. Of course if I = was using C++ I would create a linked list object and have methods to = work upon the container. You could create a global pointer for the list, and by putting it in = 'list' namespace you can avoid exposing it to global scope. I can't = remember the exact best way of doing it this way off the top of my head = though. What is currently being done is OK for demonstrating the use of = a linked list, but what I have mentioned is more applicable for an = implementation you are more likely to use in a real world application. I don't use references much myself so I don't know much about thier = syntax. Something I did read in Stroustrup was that you should avoid = modifying values passed as arguments and instead use return values, = because the user may not be aware that you have modified a value they = passed. In the end the choice is yours, so use what you want. It may be helpful = to be aware of the alternatives. My explanation might not be very good = as I'm having trouble trying to explain what I feel is right. I tend to = rely on intuition a bit when deciding on how to go about a piece of = code. Ask your teacher and see what he/she thinks about it? In the end this is all over the top for what is needed so just ignore = me. ;) Jason. ----- Original Message -----=20 From: Jason Silverman=20 To: dev...@li...=20 Sent: Saturday, November 10, 2001 1:43 AM Subject: Re: [Dev-C++] my delete function in my linked list Hey everyone, Why would you use a struct like that over just using a pointer = like he has? I've just been taught linked lists recently in school, have a test = monday on them actually...but I don't see the advantage of using the = struct over the pointer if you are only going to keep the start pointer. = Of course like you said, if you want an end pointer or the size of the = struct... As well, I was taught *& too, p is before r in the alphabet was = the little way to remember it. Jay ----- Original Message -----=20 From: Jason Hardman=20 To: Dev-C++=20 Sent: Friday, November 09, 2001 8:20 PM Subject: Re: [Dev-C++] my delete function in my linked list I'm a bit confused by your use of *&list in the arguments. I assume = you you want a reference to the list pointer so you can modify it, but I = would have thought that the correct notation would be &*list, or maybe = &(*list)? I don't have any experience in doing that as it is probably a bad way = of programming (no offence). Usualy when creating a list you put it in = a container, i.e. struct list { node *start; }; You can then pass a pointer to the list struct and the fuctions will = operate on it's start member. In some lists you can also keep a pointer to = the end, or maintain number for the size of the list. I bet you are doing = this for a lesson, otherwise it would be easier to use the C++ STL container = list. |
From: Jennifer D. <jen...@ve...> - 2001-11-10 01:58:03
|
Please unsubscribe me. Thanks. |
From: Jason S. <mys...@op...> - 2001-11-10 01:43:47
|
Hey everyone, Why would you use a struct like that over just using a pointer like he has? I've just been taught linked lists recently in school, have a test monday on them actually...but I don't see the advantage of using the struct over the pointer if you are only going to keep the start pointer. Of course like you said, if you want an end pointer or the size of the struct... As well, I was taught *& too, p is before r in the alphabet was the little way to remember it. Jay ----- Original Message ----- From: Jason Hardman To: Dev-C++ Sent: Friday, November 09, 2001 8:20 PM Subject: Re: [Dev-C++] my delete function in my linked list I'm a bit confused by your use of *&list in the arguments. I assume you you want a reference to the list pointer so you can modify it, but I would have thought that the correct notation would be &*list, or maybe &(*list)? I don't have any experience in doing that as it is probably a bad way of programming (no offence). Usualy when creating a list you put it in a container, i.e. struct list { node *start; }; You can then pass a pointer to the list struct and the fuctions will operate on it's start member. In some lists you can also keep a pointer to the end, or maintain number for the size of the list. I bet you are doing this for a lesson, otherwise it would be easier to use the C++ STL container list. |
From: Jason H. <jas...@bt...> - 2001-11-10 01:21:40
|
I'm not entirely sure what you believe is supposed to happen in it as is, but you aren't keeping track of the node before the one with your info in it. You need that so you can link around the one you are removing, as it is a one-way linked list. Also, and I cannot stress this enough, you *MUST* delete the pointer to the node you have, you don't have to do it in the function, but as you don't return the node you remove you are losing it's pointer. Try somethink like: node delete_from(node *&list, int info) { node *back, *current; current = list; back = NULL; while(current->next != NULL) { if(current->data == info) { // found node if(back) back->next = current->next; else list = list->next; // change start pointer return current; // return old node } else { // skip to next, but keep a copy of the old node back = current; current = current->next; } } } I'm a bit confused by your use of *&list in the arguments. I assume you you want a reference to the list pointer so you can modify it, but I would have thought that the correct notation would be &*list, or maybe &(*list)? I don't have any experience in doing that as it is probably a bad way of programming (no offence). Usualy when creating a list you put it in a container, i.e. struct list { node *start; }; You can then pass a pointer to the list struct and the fuctions will operate on it's start member. In some lists you can also keep a pointer to the end, or maintain number for the size of the list. I bet you are doing this for a lesson, otherwise it would be easier to use the C++ STL container list. Jason. PS: I've not tested the function, I'll leave that to you, but I think it should work. ----- Original Message ----- From: "chromatonus 712" <chr...@ho...> To: <dev...@li...> Sent: Saturday, November 10, 2001 12:01 AM Subject: [Dev-C++] my delete function in my linked list > hi, my delete function (deleting a node with a user-entered number, no > repetitions in the list) doesn't work and i can't find what's wrong. thanks > > > #include <iostream.h> > #include <conio.h> > #include <stdlib.h> > #include <math.h> > > > struct node > { > int data; > node *next; > }; > > > //PROTOTYPES > > int menu(); > node create(); > node add_front(node *&list, int info); > //node add_back(node *&list); > node delete_from(node *&list, int info); > void display(node *list); > void exit(); > > > int menu() > { > int choice; > > cout<< "LINKED LIST EDITOR MENU OPTIONS" << "\n"; > > cout<< "1. Create List" << "\n"; > cout<< "2. Add to Front of List" << "\n"; > cout<< "3. Add to Back of List" << "\n"; > cout<< "4. Display List" << "\n"; > cout<< "5. Delete from List" << "\n"; > cout<< "10. Exit" << "\n" << "\n"; > cout<< "choice? "; > cin>> choice; > return(choice); > } > > int main() > { > node *list = NULL; > int choice, info; > choice = menu(); > while( choice != 10 ) > { > switch( choice ) > { > case 1: create(); > break; > case 2: > > cout<< "input? "; > cin>> info; > add_front(list, info); > cout<< "choice? "; > cin>> choice; > break; > > //case 3: add_back(list); > // break; > case 4: display(list); > cout<< "choice? "; > cin>> choice; > break; > case 5: cout<< "number to delete? "; > cin>> info; > delete_from(list, info); > cout<< "choice? "; > cin>> choice; > break; > case 10: exit(); > break; > choice = menu(); > } > } > > } > > > node create() > { > node *list = new node; > list = NULL; > } > > node add_front(node *&list, int info) > { > > node *head = new node; > head -> data = info; > head -> next = list; > list = head; > > > } > > //node add_back(node *&list) > //{ > // int info; > // cout<< "input? "; > // cin>> info; > // if (list == NULL) > // { > // node *tail = new node; > // tail -> next = NULL; > // list -> next = tail; > // } > // else > // { > // node *tail = new node; > // tail -> next = NULL; > // tail -> next = tail; > // } > //} > > node delete_from(node *&list, int info) > { > > node *hold, *jump; > > hold = list; > jump = hold -> next; > while(hold != NULL) > { > if(hold -> data == info) > { > hold = jump; > list -> next = jump; > jump = hold -> next; > } > else > { > hold = jump; > jump = hold -> next; > } > } > } > > void display(node *list) > { > while(list != NULL) > { > cout<< list -> data << " "; > list = list -> next; > } > system("PAUSE"); > } > > void exit() > { > system("PAUSE"); > } > > > _________________________________________________________________ > 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: chromatonus 7. <chr...@ho...> - 2001-11-10 00:01:59
|
hi, my delete function (deleting a node with a user-entered number, no repetitions in the list) doesn't work and i can't find what's wrong. thanks #include <iostream.h> #include <conio.h> #include <stdlib.h> #include <math.h> struct node { int data; node *next; }; //PROTOTYPES int menu(); node create(); node add_front(node *&list, int info); //node add_back(node *&list); node delete_from(node *&list, int info); void display(node *list); void exit(); int menu() { int choice; cout<< "LINKED LIST EDITOR MENU OPTIONS" << "\n"; cout<< "1. Create List" << "\n"; cout<< "2. Add to Front of List" << "\n"; cout<< "3. Add to Back of List" << "\n"; cout<< "4. Display List" << "\n"; cout<< "5. Delete from List" << "\n"; cout<< "10. Exit" << "\n" << "\n"; cout<< "choice? "; cin>> choice; return(choice); } int main() { node *list = NULL; int choice, info; choice = menu(); while( choice != 10 ) { switch( choice ) { case 1: create(); break; case 2: cout<< "input? "; cin>> info; add_front(list, info); cout<< "choice? "; cin>> choice; break; //case 3: add_back(list); // break; case 4: display(list); cout<< "choice? "; cin>> choice; break; case 5: cout<< "number to delete? "; cin>> info; delete_from(list, info); cout<< "choice? "; cin>> choice; break; case 10: exit(); break; choice = menu(); } } } node create() { node *list = new node; list = NULL; } node add_front(node *&list, int info) { node *head = new node; head -> data = info; head -> next = list; list = head; } //node add_back(node *&list) //{ // int info; // cout<< "input? "; // cin>> info; // if (list == NULL) // { // node *tail = new node; // tail -> next = NULL; // list -> next = tail; // } // else // { // node *tail = new node; // tail -> next = NULL; // tail -> next = tail; // } //} node delete_from(node *&list, int info) { node *hold, *jump; hold = list; jump = hold -> next; while(hold != NULL) { if(hold -> data == info) { hold = jump; list -> next = jump; jump = hold -> next; } else { hold = jump; jump = hold -> next; } } } void display(node *list) { while(list != NULL) { cout<< list -> data << " "; list = list -> next; } system("PAUSE"); } void exit() { system("PAUSE"); } _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |