dev-cpp-users Mailing List for Dev-C++ (Page 649)
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: 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
|
|
From: Jason H. <jas...@bt...> - 2001-11-09 23:20:38
|
Also in the Create() function you create a node and put it the list pointer
you create, then you overwrite that pointer with NULL, which is a memory
leak as you don't deallocate the node you created. Also the function doesn't
return anything.
Jason.
----- Original Message -----
From: "Williams, Timothy W." <TIM...@sa...>
To: "'chromatonus 712'" <chr...@ho...>;
<dev...@li...>
Sent: Friday, November 09, 2001 11:07 PM
Subject: RE: [Dev-C++] linked lists
> In your main(), when you declare your first pointer to a node you need to
> set that equal to NULL or 0. The problem you were having is when you add
> you were taking whatever address that was in list and just plunking it
right
> in ->next which isn't so bad if it's a good address but the way it was
> written, when you were displaying it, it looped fine, but never got to
NULL
> and instead just trotted off into memory.
> node *list = NULL;
> instead of...
> node *list;
>
> --tim
>
> > -----Original Message-----
> > From: chromatonus 712 [mailto:chr...@ho...]
> > Sent: Friday, November 09, 2001 5:44 PM
> > To: dev...@li...
> > Subject: [Dev-C++] linked lists
> >
> >
> > hi, if you'd like to help, this is a menu of functions doing
> > operations on a
> > linked list, and i have a runtime error after i performed
> > add_front() and
> > displayed the list. The correct list was displayed but the
> > error message
> > came right after. Can you please find out what's wrong? Thank you!
> >
> > and, is there an equivalent expression for the Borland
> > gotoxy() in Dev?
> > 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);
> > 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;
> > 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: delete_from(list);
> > 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;
> > cout<< "number to delete? ";
> > cin>> info;
> > 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
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Williams, T. W. <TIM...@sa...> - 2001-11-09 23:08:04
|
In your main(), when you declare your first pointer to a node you need to
set that equal to NULL or 0. The problem you were having is when you add
you were taking whatever address that was in list and just plunking it right
in ->next which isn't so bad if it's a good address but the way it was
written, when you were displaying it, it looped fine, but never got to NULL
and instead just trotted off into memory.
node *list = NULL;
instead of...
node *list;
--tim
> -----Original Message-----
> From: chromatonus 712 [mailto:chr...@ho...]
> Sent: Friday, November 09, 2001 5:44 PM
> To: dev...@li...
> Subject: [Dev-C++] linked lists
>
>
> hi, if you'd like to help, this is a menu of functions doing
> operations on a
> linked list, and i have a runtime error after i performed
> add_front() and
> displayed the list. The correct list was displayed but the
> error message
> came right after. Can you please find out what's wrong? Thank you!
>
> and, is there an equivalent expression for the Borland
> gotoxy() in Dev?
> 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);
> 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;
> 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: delete_from(list);
> 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;
> cout<< "number to delete? ";
> cin>> info;
> 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-09 22:44:16
|
hi, if you'd like to help, this is a menu of functions doing operations on a
linked list, and i have a runtime error after i performed add_front() and
displayed the list. The correct list was displayed but the error message
came right after. Can you please find out what's wrong? Thank you!
and, is there an equivalent expression for the Borland gotoxy() in Dev?
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);
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;
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: delete_from(list);
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;
cout<< "number to delete? ";
cin>> info;
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
|
|
From: Christiaan S. <ck...@ia...> - 2001-11-09 22:16:47
|
try the source found here for an opengl screensaver skeleton... I ha= vent gotten it to work right yet http://www.ite.mh.se/~danli97/opengl/minimal.zip -----Original Message----- =46rom: Gregor Peter <pe...@in...> To: Stein Nyg=E5rd <ste...@ge...> Cc: DevCpp <dev...@li...> Date: Wednesday, November 07, 2001 7:27 AM Subject: Re: [Dev-C++] Screensaver! Some time ago you asked this but I couldn't see if you got an answer = already PlaySound is a little tricky I had the same problem once include <mmsystem.h> and tell your compiler/linker to use libwinmm.a from DevC++ Lib-Directory ( ...\DevC++\Lib\libwinmm.a ) The linkeroption -lwinmm should do it Good luck :-) Gregor (pe...@in...) ----- snip ----- Stein Nyg=E5rd wrote: > Please... can someone tell me how to make my opengl-apps work as a > screensaver. Like, I would like them to be named stuff like somethi= n.scr > and so that one could choose them in the windows screensaver settin= gs. I > really would aprreciate some help on this. > > Oh, and I also have another problem... where is PlaySound(); define= d? > > > > Thanks alot, Stein > _______________________________________________ Dev-cpp-users mailing list Dev...@li... https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Williams, T. W. <TIM...@sa...> - 2001-11-09 21:12:24
|
#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
>
|
|
From: Mansoor N. <man...@sy...> - 2001-11-09 20:46:07
|
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));
}
|
|
From: Williams, T. W. <TIM...@sa...> - 2001-11-09 16:19:19
|
I've never really used Visual C++, but I've found that most editors function as I describe, including jEdit, KDevelop, and Emacs among others. It just doesn't seem very intuitive for the page to be filled with whitespace when you've never hit the space bar or tab key. --tim >not sure how to do that. But when I got started with Visual C++ I found that part of the >interface (clicking on a line goes to the last available space) to be a pain lol. >>From: "Williams, Timothy W." >>To: "'dev...@li...'" >>Subject: [Dev-C++] Editor question >>Date: Thu, 8 Nov 2001 17:35:30 -0500 >> >>I'm new to dev-c++. is there a way to make the editor recognize line breaks >>and white space differently. actually, i'm not sure if that's the right >>question, so i'll describe it. right now i can click my mouse anywhere in >>the editor pane and the cursor will go there but i'm used to (and would >>prefer) to have the cursor go to the last available space. in other words >>properly follow the white space/ control characters. it seems like it just >>inserts false whitespace in the entire editor. thanks, >>--tim https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Daniel G. <sp...@ho...> - 2001-11-09 16:03:57
|
<html><div style='background-color:'><DIV> <P>not sure how to do that. But when I got started with Visual C++ I found that part of the interface (clicking on a line goes to the last available space) to be a pain lol.<BR><BR></P></DIV> <DIV></DIV> <DIV></DIV>>From: "Williams, Timothy W." <TIM...@SA...> <DIV></DIV>>To: "'dev...@li...'" <DEV...@LI...> <DIV></DIV>>Subject: [Dev-C++] Editor question <DIV></DIV>>Date: Thu, 8 Nov 2001 17:35:30 -0500 <DIV></DIV>> <DIV></DIV>>I'm new to dev-c++. is there a way to make the editor recognize line breaks <DIV></DIV>>and white space differently. actually, i'm not sure if that's the right <DIV></DIV>>question, so i'll describe it. right now i can click my mouse anywhere in <DIV></DIV>>the editor pane and the cursor will go there but i'm used to (and would <DIV></DIV>>prefer) to have the cursor go to the last available space. in other words <DIV></DIV>>properly follow the white space/ control characters. it seems like it just <DIV></DIV>>inserts false whitespace in the entire editor. thanks, <DIV></DIV>>--tim <DIV></DIV>> <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: Brian M. <str...@ho...> - 2001-11-09 02:32:16
|
How do I make windows consoles with dev-cpp? _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |
|
From: carlos D. M. <cg...@wo...> - 2001-11-08 22:59:44
|
Well, when i said unicode i wanted say ASCII and UNICODE both. And now I achieved with ASCII to print them in a console program.... with a little problem: with cout.put(number), after the character appears the number, and with putchar(number) 0xfffffff after the character. Well, now I need find if there are another equivalent funcion I can use for do it. But I hope it is a problem for console programs, thank you. I must change to learn windows programs. I achieved it!!!!!!!! With this strange thing (and complex, I still need pass to windows and forget the consoles): cout << static_cast<char>(static_cast<int>(static_cast<char>(160))) << endl; Where 160 is the ASCII number for á. |
|
From: Williams, T. W. <TIM...@sa...> - 2001-11-08 22:35:54
|
I'm new to dev-c++. is there a way to make the editor recognize line breaks and white space differently. actually, i'm not sure if that's the right question, so i'll describe it. right now i can click my mouse anywhere in the editor pane and the cursor will go there but i'm used to (and would prefer) to have the cursor go to the last available space. in other words properly follow the white space/ control characters. it seems like it just inserts false whitespace in the entire editor. thanks, --tim |
|
From: Elias P. <eli...@ao...> - 2001-11-08 18:19:22
|
> I have a problem with this compiler: When I try to write in the output > a character with accent or an ñ or ¿ or ¡, the (at this moment > console) program writes other character, a phi for í, beta for á, > more-or-less for ñ... I think this problem will go away if you don't write to the console, but to a window. Probably the console uses another codepage (for ASCII characters > 127) as dev-c++ (or any other windows editor, it seems). I don't know how you can use these characers in a console, but probably you will have to translate them to some old DOS codepage. Maybe you can find info at microsoft. (http://msdn.microsoft.com) ... > So in Dev-C++ 5, it would be nice to make a compiler with support for > international characters in an easy way, avoiding the need of > questioning how to do it (support for unicode). (Or make it work fine). I never used unicode myself, but I'm almost sure that .c/.cpp source files are always ASCII, and not unicode - so writing unicode directly inside the source code can't work. You have to write your unicode strings with an editor supporting unicode (i'm not sure if it could be integrated into dev-c++), and then you can display them in your program, e.g. by using the Win32 API. -- Elias Pschernig |
|
From: Elias P. <eli...@ao...> - 2001-11-08 18:00:16
|
> Whenever I attempt to put stuff in the .rc file of a project, I receive > parse errors like the one on line 4 of this code: > #include "resource.h" > > IDD_ABOUT DIALOG DISCARDABLE 0, 0, 239, 66 > STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU You should put #include <windows.h> as the first line of your .rc file, else you can't use defined values like WS_POPUP.. -- Elias Pschernig |
|
From: carlos D. M. <cg...@wo...> - 2001-11-08 17:27:42
|
I have a problem with this compiler: When I try to write in the output a character with accent or an ñ or ¿ or ¡, the (at this moment console) program writes other character, a phi for í, beta for á, more-or-less for ñ... I found a page in www.cplusplus.org with the unicode for characters, and I tried them with the cout.put() function, and it didn't work. I found the official page of unicode http://unicode.org, and neither, now it writes something like 0xffffffffffffffff. And I haven't find anymore about it. What can I do? I CANNOT FORGIVE ME (and nobody) WRITE A BAD LANGUAGE IF IT IS MINE COUNTRY LANGUAGE. IF I AM SPANISH I MUST SPEAK AND WRITE PERFECT SPANISH. (i forgive to those who are not spanish or spanish speaker countries, of course) In regard to the Chris Hague message about .rc files, I have the same problem, and I sorry because I don't know solve it, I say for know you that that problem is not only for one person. I have the same with the bitmap item. And with the font item it doesn't load the fonts. So in Dev-C++ 5, it would be nice to make a compiler with support for international characters in an easy way, avoiding the need of questioning how to do it (support for unicode). (Or make it work fine). And solve those problems. That can seem *not-to-this-list-questions* but that *can-discover-some-fails-of-this-program*. *or-foolishness-of-who-sends-it* |
|
From: Jason H. <jas...@bt...> - 2001-11-07 17:00:24
|
The reason you get that problem is because you now have to cast a void pointer into the type you are using, and the old C style dynamic allocation functions will always return a void pointer as they have no way of determining the type of the value returned. i.e. char *currentObjName = static_cast<char*>(calloc(100, sizeof(char))); or if you are using C only you can use the old style cast: (char*) for C++... yes you can use strings, but you can also use the new and delete (or delete[]) operators. Strings are better for simplicity of use. Jason. ----- Original Message ----- From: "Gregor Peter" <pe...@in...> To: <dev...@li...> Sent: Wednesday, November 07, 2001 5:21 AM Subject: [Dev-C++] C vs C++ > My Compiler complains about the following codelines > > lineNo: c-code > 59: char *currentObjName = calloc( 100, sizeof( char ) ); > 60: char *token1 = calloc( 25, sizeof( char ) ); > 63: char *mltext, *ptext, *str; > 64: mltext = malloc( 10*sizeof(char)); > 318: mltext = realloc( mltext, (strlen(mltext)+yyleng)*sizeof(char) ); > 329: mltext = realloc( mltext, (strlen(mltext)+1)*sizeof(char) ); > > The compilers errmsg is: > > SCANNER.LEX:'lineNo': ANSI C++ forbids implicit conversion from > `void *' in initialization > > > Can tell me someone how to rewrite this ANSI C++ compatible? > > THANX > Gregor (pe...@in...) > > > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |