dev-cpp-users Mailing List for Dev-C++ (Page 497)
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: <pr...@le...> - 2002-10-29 05:24:49
|
Hi list, Now this is an absolute newbie question, quite befitting me. I've started dabbling with the black arts of C++ recently. Today, while writing a windows application, I came across a strange situation. If I compile and run just the unit (i.e. main.cpp) file on its own, I get a console window running at the back of the application window. But if I compile the entire project (i.e. winapp.dev) then I don't get a console. Can someone explain what lies in the project file that causes the console to disappear? This is not a commercial project that I'm working on, so it really isn't a matter of whether I want the console or not, but rather WHAT causes the console to appear in the first place. Any help appreciated. Thanks in advance. Pranav Negandhi Software Engineering Learnet India Limited, Mumbai. Phone: 91-22-859 8042 Ext: 316 http://www.learnetindia.com |
|
From: B. <ama...@uo...> - 2002-10-29 02:14:50
|
Gentlemen,
Where can I download a .PDF manual of Dev-C++? Its environment,
tricks like include conio.o to make clrscr() works, put -lwsock32 in the
Project Options to run Tcp/Ip console programs under Win, insert break
commands in the GDB, run and make display commands of the variables to
follow step-by-step executions,...., things like that?
I've read some messages about an invitation to make a Dev-C++
manual. Is it exist? A manual?
Regards
Andr=E9
|
|
From: B. <ama...@uo...> - 2002-10-29 02:11:44
|
Gentlemen,
1-Let Consider 3 files in a Project File:
-A header file, .h containing the interface of the class, that is,
the prototype of the functions, and even in-line functions;
-A imp.cpp containing the implementation of the functions of the
class presented in the header file; and
-A main.cpp containing the client program that instatiates a object
that makes use of the public functions specified in the header file.
2-Let suppose the project is running in the integrated environment of
Dev-C++;
3-How can I suppress the source code of the imp.cpp file to hide the
implementation and perform a link only with its object file with
Dev-C++?
Regards
Andr=E9
|
|
From: B. <ama...@uo...> - 2002-10-29 01:58:49
|
Gentelmen,
Sorry about the off-topic question, but let me know if you can help:
1. Consider the following Class
Class any{
public:
any (int x=3D0, int y=3D0, int z=3D0);
void dummy_func1();
void not_so_dummy_func2();
void very_important_func3();
void only_for_bad_boys_func4();
private:
int x;
int y;
int z;
};
2. Let suppose 3 different groups of users (supose programmers):
"The dummies", "The Nerds", and "The Bad Boys"
3. I want to restrict the access to the public functions by group,
that is, dummies programs only accessing func1, nerds programs accessing
func1 to func3, and badboys programs accessing all the functions;
4. Is it possible do this, step 3, in C++?
5. If item 4 is possible, is it possible in Dev-C++? How?
Regards
Andr=E9
|
|
From: B. <ama...@uo...> - 2002-10-29 01:43:37
|
Gentlemen, A long time ago, working with Borland Turbo C or Turbo C++, everytime I had a question about a command, printf, for example, or struct, what is it or how it is employed, I put the cursor bellow the command and pressed Cntrl-F1. A help window appeared telling me how to use, and in some cases, even a example. Is there any resource like this in Dev-C++? Regards |
|
From: Per W. <pw...@ia...> - 2002-10-28 19:55:11
|
Well, your questions are still about school assignments, even if you
now have removed any comments to your teachers requirements, but...
Might you tell us how you expected the "mystring" parameter to pop and
temp_pop to actually return anything to the caller? Yes inside your
function, mystring is a variable like everything else. Then you assign a
new pointer to the parameter, and copy a string value to the newly
allocated buffer space.
/Per W
On Mon, 28 Oct 2002, senem beken wrote:
>
> when i try to get the elements back from a function i wrote, i get an error called "access violation" and i don't know what that is.i'd be glad if anyone who has time would look at it...i'm sending one part of the code, the one which doesn't work...
> kind regards...
> int removecar(int garagenum,char *mystring){
> int i=0;
> char plaka[10];
> if(garagenum==1){
> while(strcmp(garage1.plate[i],mystring)==0){
> pop(plaka,garage1);
> push(plaka,temporary);
> i++;
> }
>
> while(isempty(temporary)!=1){
> pop(plaka,temporary);
> push(plaka,garage1);
> }
> temp_pop(plaka,garage3);
> push(plaka,garage1);
> return 1;
> }
> if(garagenum==2){
> i=0;
> while(strcmp(garage2.plate[i],mystring)==1){
> pop(plaka,garage2);
> push(plaka,temporary);
> i++;
> }
>
> while(!isempty(temporary)){
> pop(plaka,temporary);
> push(plaka,garage2);
> }
> temp_pop(plaka,garage3);
> push(plaka,garage2);
> return 1;
> }
> if(garagenum==3){
> if(findel(garage1,mystring)){
> while(strcmp(garage1.plate[i],mystring)==1){
> pop(plaka,garage1);
> push(plaka,temporary);
> i++;
> }
>
> while(!isempty(temporary)){
> pop(plaka,temporary);
> push(plaka,garage1);
> }
> return 1;
> }
> if(findel(garage2,mystring)){
> while(strcmp(garage2.plate[i],mystring)==1){
> pop(plaka,garage2);
> push(plaka,temporary);
> i++;
> }
>
> while(!isempty(temporary)){
> pop(plaka,temporary);
> push(plaka,garage2);
> }
> return 1;
> }
> if(temp_findel(garage3,mystring)){
> temp_pop(plaka,garage3);
> return 1;
> }
> if(!temp_findel(garage3,mystring)&&!findel(garage2,mystring)&&
> !findel(garage1,mystring))
>
> return 0;
> }
> }
>
> void pop(char *mystring,garage &line){
> if(isempty(line)){
> cout<<"error,can't pop,stack empty"<<endl;
> exit(1);
> }
> else{
> line.top--;
> mystring=new char[sizeof(line.plate[line.top])/sizeof(char)];
> strcpy(mystring,line.plate[line.top]);
> line.elements--;
> }
> }
> void temp_pop(char *mystring,temp_storage &line){
> if(temp_isempty(line)){
> cout<<"error,can't pop,stack empty"<<endl;
> exit(1);
> }
> else{
> line.temptop--;
> mystring=new char[sizeof(line.tempplate[line.temptop])
> /sizeof(char)];
> strcpy(mystring,line.tempplate[line.temptop]);
> line.tempelements--;
> }
> }
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site
|
|
From: Eric R. <e.r...@pa...> - 2002-10-28 19:07:06
|
Hi group Is it possible not to send HTML Emails because they are about 2.5 times bigger than a standard text Email, the one below could of been sent in plain text format and no one would of been the wiser. HTML Email can also carry a type of Email virus. http://www.georgedillon.com/web/html_email_is_evil.shtml (7 REASONS WHY HTML E-MAILS ARE EVIL.) From Eric NO ATTACHMENT WAS SENT WITH THIS EMAIL, IF THERE IS ONE, IT IS A UNDETECTED VIRUS, PLEASE LET ME KNOW.. Black text on white background HTML Emails and replied with white text on white. -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of senem beken Sent: 28 October 2002 23:13 To: dev...@li... Subject: [Dev-C++] elements from an array of pointers... when i try to get the elements back from a function i wrote, i get an error called "access violation" and i don't know what that is.i'd be glad if anyone who has time would look at it...i'm sending one part of the code, the one which doesn't work... kind regards... int removecar(int garagenum,char *mystring){ int i=0; char plaka[10]; if(garagenum==1){ while(strcmp(garage1.plate[i],mystring)==0){ pop(plaka,garage1); push(plaka,temporary); i++; } while(isempty(temporary)!=1){ pop(plaka,temporary); push(plaka,garage1); } temp_pop(plaka,garage3); push(plaka,garage1); return 1; } if(garagenum==2){ i=0; while(strcmp(garage2.plate[i],mystring)==1){ pop(plaka,garage2); push(plaka,temporary); i++; } while(!isempty(temporary)){ pop(plaka,temporary); push(plaka,garage2); } temp_pop(plaka,garage3); push(plaka,garage2); return 1; } if(garagenum==3){ if(findel(garage1,mystring)){ while(strcmp(garage1.plate[i],mystring)==1){ pop(plaka,garage1); push(plaka,temporary); i++; } while(!isempty(temporary)){ pop(plaka,temporary); push(plaka,garage1); } return 1; } if(findel(garage2,mystring)){ while(strcmp(garage2.plate[i],mystring)==1){ pop(plaka,garage2); push(plaka,temporary); i++; } while(!isempty(temporary)){ pop(plaka,temporary); push(plaka,garage2); } return 1; } if(temp_findel(garage3,mystring)){ temp_pop(plaka,garage3); return 1; } if(!temp_findel(garage3,mystring)&&!findel(garage2,mystring)&& !findel(garage1,mystring)) return 0; } } void pop(char *mystring,garage &line){ if(isempty(line)){ cout<<"error,can't pop,stack empty"<<endl; exit(1); } else{ line.top--; mystring=new char[sizeof(line.plate[line.top])/sizeof(char)]; strcpy(mystring,line.plate[line.top]); line.elements--; } } void temp_pop(char *mystring,temp_storage &line){ if(temp_isempty(line)){ cout<<"error,can't pop,stack empty"<<endl; exit(1); } else{ line.temptop--; mystring=new char[sizeof(line.tempplate[line.temptop]) /sizeof(char)]; strcpy(mystring,line.tempplate[line.temptop]); line.tempelements--; } } ---------------------------------------------------------------------------- ---- Do you Yahoo!? Y! Web Hosting - Let the expert host your web site --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.408 / Virus Database: 230 - Release Date: 24/10/02 |
|
From: senem b. <sbe...@ya...> - 2002-10-28 10:12:42
|
when i try to get the elements back from a function i wrote, i get an error called "access violation" and i don't know what that is.i'd be glad if anyone who has time would look at it...i'm sending one part of the code, the one which doesn't work...
kind regards...
int removecar(int garagenum,char *mystring){
int i=0;
char plaka[10];
if(garagenum==1){
while(strcmp(garage1.plate[i],mystring)==0){
pop(plaka,garage1);
push(plaka,temporary);
i++;
}
while(isempty(temporary)!=1){
pop(plaka,temporary);
push(plaka,garage1);
}
temp_pop(plaka,garage3);
push(plaka,garage1);
return 1;
}
if(garagenum==2){
i=0;
while(strcmp(garage2.plate[i],mystring)==1){
pop(plaka,garage2);
push(plaka,temporary);
i++;
}
while(!isempty(temporary)){
pop(plaka,temporary);
push(plaka,garage2);
}
temp_pop(plaka,garage3);
push(plaka,garage2);
return 1;
}
if(garagenum==3){
if(findel(garage1,mystring)){
while(strcmp(garage1.plate[i],mystring)==1){
pop(plaka,garage1);
push(plaka,temporary);
i++;
}
while(!isempty(temporary)){
pop(plaka,temporary);
push(plaka,garage1);
}
return 1;
}
if(findel(garage2,mystring)){
while(strcmp(garage2.plate[i],mystring)==1){
pop(plaka,garage2);
push(plaka,temporary);
i++;
}
while(!isempty(temporary)){
pop(plaka,temporary);
push(plaka,garage2);
}
return 1;
}
if(temp_findel(garage3,mystring)){
temp_pop(plaka,garage3);
return 1;
}
if(!temp_findel(garage3,mystring)&&!findel(garage2,mystring)&&
!findel(garage1,mystring))
return 0;
}
}
void pop(char *mystring,garage &line){
if(isempty(line)){
cout<<"error,can't pop,stack empty"<<endl;
exit(1);
}
else{
line.top--;
mystring=new char[sizeof(line.plate[line.top])/sizeof(char)];
strcpy(mystring,line.plate[line.top]);
line.elements--;
}
}
void temp_pop(char *mystring,temp_storage &line){
if(temp_isempty(line)){
cout<<"error,can't pop,stack empty"<<endl;
exit(1);
}
else{
line.temptop--;
mystring=new char[sizeof(line.tempplate[line.temptop])
/sizeof(char)];
strcpy(mystring,line.tempplate[line.temptop]);
line.tempelements--;
}
}
---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site |
|
From: Paul B. <pa...@ad...> - 2002-10-28 04:45:26
|
I still don't understand why the same program in C is ~10k where in C++ it's ~49k just to call a Windows function. Paul --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.401 / Virus Database: 226 - Release Date: 9/10/2002 |
|
From: Louis G. <lg...@ya...> - 2002-10-28 01:29:34
|
I agree. This system("PAUSE") issue keeps coming up over and over again.
I suggest whenever one selects to create a console app in DevC++ that
in the main { ...} shell should contain a system("PAUSE") statement.
--- Per Westermark <pw...@ia...> wrote:
> I just whish that whenever Dev-C++ is run for the first time, it would
> display a VERY large text message requiring at least ten mouse clicks to
> close.
>
> For pause of cmd programs, insert system("PAUSE");
> For help files, do...
>
> There are a couple of questions that arrives a bit more often than
> others
> :-)
>
> /Per W
>
> On Sat, 26 Oct 2002, Hans-Jörg Stangor wrote:
>
> > Hi Sivan,
> >
> > >>when i try to run a program the output screen flashes by so fast i
> can't
> > actually >>see the output!
> > >>what can i do to make the output screen stay?
> >
> > Before your return statement inside the main() routine insert a
> >
> > system("Pause");
> >
> > statement.
> >
> > Here a short example that should work for you:
> >
> > #include <iostream.h>
> > #include <stdlib.h>
> >
> > int main(int argc, char *argv[])
> > {
> > cout << "Hi there!!!...\r\n";
> > system("PAUSE");
> > return 0;
> > }
> >
> >
> > >>and another question, why can't the program find "help"?
> >
> > Help is not included but you can use the vUpdate Program
> > to load it from the Update-Server. You will find a lot of things
> > to download (about 50 single downloads) but most important is
> > i guess to get the latest vUpdate Program first (done automatically)
> > and afterwards the latest Dev-Cpp, the Help File and the tips for
> > the language you have set your IDE to. (Dont wonder if you have to
> > update Dev-Cpp immediately after you downloaded it... it is some
> > versions behind the current version because of the fast development
> > cycle of the code monkeys :-) [And i think you do a fabulous work,
> > guys!)
> >
> > The download
> > speed depends on the time of day a little i found out... a lot
> > of persons seem to update on a regular basis :-)
> >
> > You also should check the Resource Page found on Bloodshed Webpage
> > for a lot of useful tutorials. And if you're in search for a free
> ebook try
> > Thinking in C++ by Bruce Eckel. It's located on www.mindview.net . But
> > i posted that already a while back here :-)
> >
> > Hope this helps.
> >
> > Best wishes,
> > Hans-Jörg (who's also trying to get started with C++)
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: ApacheCon, November 18-21 in
> > Las Vegas (supported by COMDEX), the only Apache event to be
> > fully supported by the ASF. http://www.apachecon.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
> >
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: ApacheCon, November 18-21 in
> Las Vegas (supported by COMDEX), the only Apache event to be
> fully supported by the ASF. http://www.apachecon.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
__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/
|
|
From: Per W. <pw...@ia...> - 2002-10-27 21:52:44
|
Ah, I don't think you really read the information in the received mail. It wasn't to this address that you was supposed to send your request. I don't have the exact name infront of me, but it was something like dev-cpp-users-request@... /Per W On Sun, 27 Oct 2002 Rm...@ao... wrote: > confirm 429973 > |
|
From: <Rm...@ao...> - 2002-10-27 21:16:35
|
confirm 429973 |
|
From: Colin L. <ha...@bl...> - 2002-10-27 20:56:37
|
Hello, We are in a real need of contributors to write the main Dev-C++ help file and tutorial. I believe the help file could be really more effective and complete if some experienced Dev-C++ users contributes to writing sections for it, in conjunction with Dev-C++ developers. If you think you can help us on this task, please contact me at ha...@bl... Having a good help file and tutorial is VERY important to this project, so i hope some people will volunteer for helping in achieving this task. Greetings :) Colin Laplace |
|
From: <h.r...@gm...> - 2002-10-27 18:58:14
|
> > I've tried that but its still the same size. > > Try using UPX, an executable compressor. It should be available at > http://www.upx.org/. Otherwise, search on google. > > ___________________________________________________________ > > Abhijit Shylanath it's: http://upx.sourceforge.net/#download -- +++ GMX - Mail, Messaging & more http://www.gmx.net +++ NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen! |
|
From: Per W. <pw...@ia...> - 2002-10-27 17:02:05
|
Why not use a template class for the stacks, or at least use same data type for normal and temporary storage. That would halve the amount of code. Second. Constants MAX and maximum are not exactly a premium choice of variable names. Every thought of MAX_GARAGE_SIZE or something a bit more descriptive. Third. For school work, don't you have any school pals to discussion your home assignments with? /Per W |
|
From: senem b. <sbe...@ya...> - 2002-10-27 16:27:32
|
thanks a lot, i'll try it in a few minutes...
got one more question to ask:
i wrote a program using a few stacks, i compiled it and it seems to be working... however, it doesn't do what i intend to do... in the program, there are two stacks called garage1 and garage2 and there's another stack called temporary which i use to hold the popped elements values. but i strangely can't pop the value i'm looking for, only the last element is popped... the code is huge,i'll mark the part which doesn't work and i'll be glad if anyone would look at it and tell me where i'm going wrong...
kind regards...
senem
#include <iostream.h>
#include <stdlib.h>
#include <string.h>
#define MAX 5
#define maximum 1
typedef struct garage{
int elements;
int top;
int array[MAX];
}garage;
typedef struct temp_storage{
int tempelements;
int temptop;
int temparray[maximum]; // has to be replaced with a string array
}temp_storage;
garage garage1,garage2,temporary;// temporary to store while
temp_storage garage3; // removing a car from the stacks
// 1 and 2
int addcar(int &,int &); // i don't know if it makes any sense
int removecar(int,int &); // but i have to use these 2 functions
// the teacher said
void create(garage &);
void push (int,garage&);
int pop(garage&);
int isfull(garage&);
int isempty(garage&);
void display(garage &);
void temp_create(temp_storage&);
void temp_push(int,temp_storage&);
int temp_pop(temp_storage&);
int temp_empty(temp_storage&);
int temp_full(temp_storage&);
void temp_display(temp_storage&);
int findel(garage &,int); file://reference??
void error(char *);
int temp_findel(temp_storage&,int); file://reference??
int main(){
char answer;
int garage_no=0;
int num;
create(garage1);
create(garage2);
create(temporary);
temp_create(garage3);
while(true){
cout<<"park or remove the car(p/r)";
cin>>answer;
if(answer=='p'){
cout<<"plaka no:";
cin>>num;
if(addcar(garage_no,num)){
cout<<"successfully placed"<<endl;
cout<<"car parked in the "<<garage_no
<<"th garage"<<endl;
}
else
cout<<"car not placed"<<endl;
display(garage1);
display(garage2);
temp_display(garage3);
}
else if(answer=='r'){
cout<<"number:";
cin>>num;
cout<<"garage no:";
cin>>garage_no;
if(removecar(garage_no,num))
cout<<"car found and successfully delivered"<<endl;
else
cout<<"car not found"<<endl;
display(garage1);
display(garage2);
temp_display(garage3);
}
else
error("check the entered letter");
cout<<"continue(y/n)??";
cin>>answer;
if(answer=='n')
break;
}
return 0;
}
void create(garage &line){
for(int i=0;i<MAX;i++)
line.array[i]=0;
line.elements=0;
line.top=0;
}
void temp_create(temp_storage &line){
for(int j=0;j<maximum;j++)
line.temparray[j]=0;
line.tempelements=0;
line.temptop=0;
}
void display(garage &line){
for(int k=0;k<line.top;k++)
cout<<line.array[k]<<" ";
cout<<endl;
}
void temp_display(temp_storage &line){
for(int a=0;a<line.temptop;a++)
cout<<line.temparray[a]<<" ";
cout<<endl;
}
int isfull(garage &line){
return(line.elements==MAX);
}
int temp_isfull(temp_storage &line){
return(line.tempelements==maximum);
}
int isempty(garage & line){
return(line.elements==0);
}
int temp_isempty(temp_storage &line){
return(line.tempelements==0);
}
void push(int element,garage& line){
if(!isfull(line)){
line.array[line.top]=element;
line.top++;
line.elements++;
}
else{
cout<<"error,cannot push,stack is full"<<endl;
exit(1);
}
}
void temp_push(int element,temp_storage& line){
if(!temp_isfull(line)){
line.temparray[line.temptop]=element;
line.temptop++;
line.tempelements++;
}
else{
cout<<"error,cannot push,stack is full"<<endl;
exit(1);
}
}
int pop(garage &line){
int r;
if(isempty(line)){
cout<<"error,cannot pop,stack is empty"<<endl;
exit(1);
}
else{
line.top--;
r=line.array[line.top];
line.elements--;
return r;
}
}
int temp_pop(temp_storage &line){
int result;
if(temp_isempty(line)){
cout<<"error,cannot pop,stack is empty"<<endl;
exit(1);
}
else{
line.temptop--;
result=line.temparray[line.temptop];
line.tempelements--;
return result;
}
}
int addcar(int &garagenum,int &carnum){
if(garage1.elements<MAX){
garagenum=1;
push(carnum,garage1);
return 1;
}
else if(garage2.elements<MAX){
cout<<"garage 1 is full"<<endl;
garagenum=2;
push(carnum,garage2);
return 1;
}
else if(garage3.tempelements<maximum){
cout<<"garage 1 and garage 2 are full"<<endl;
garagenum=3;
temp_push(carnum,garage3);
return 1;
}
else{
cout<<"all places reserved"<<endl;
return 0;
}
}
void error(char *sentence){
cout<<sentence<<endl;
}
/*int removecar(int garagenum,int &carnum){
int popped_num1,popped_num2,popped_num3;
int i=0;
if(garagenum==1){
while(garage1.array[i]!=carnum){
popped_num1=pop(garage1);
push(popped_num1,temporary);
i++;
}
popped_num1=pop(garage1);
while(!isempty(temporary)){
popped_num2=pop(temporary);
push(popped_num2,garage1);
}
popped_num3=temp_pop(garage3);
push(popped_num3,garage1);
return 1;
}
if(garagenum==2){
i=0;
while(garage2.array[i]!=carnum){
popped_num1=pop(garage2);
push(popped_num1,temporary);
i++;
}
popped_num1=pop(garage2);
while(!isempty(temporary)){
popped_num2=pop(temporary);
push(popped_num2,garage2);
}
popped_num3=temp_pop(garage3);
push(popped_num3,garage2);
return 1;
}
if(garagenum==3){
if(findel(garage1,carnum)){
i=0;
while(garage1.array[i]!=carnum){
popped_num1=pop(garage1);
push(popped_num1,temporary);
i++;
}
popped_num1=pop(garage1);
while(!isempty(temporary)){
popped_num2=pop(temporary);
push(popped_num2,garage1);
}
return 1;
}
if(findel(garage2,carnum)){
i=0;
while(garage2.array[i]!=carnum){
popped_num1=pop(garage2);
push(popped_num1,temporary);
i++;
}
popped_num1=pop(garage2);
while(!isempty(temporary)){
popped_num2=pop(temporary);
push(popped_num2,garage2);
}
popped_num3=temp_pop(garage3);
push(popped_num3,garage2);
return 1;
}
if(temp_findel(garage3,carnum)){
popped_num1=temp_pop(garage3);
return 1;
}
else
return 0;
}
}
*/
int findel(garage & line,int element){
for(int i=0;i<line.top;i++){
if(line.array[i]==element)
return 1;
else
return 0;
}
}
int temp_findel(temp_storage &line,int element){
for(int i=0;i<line.temptop;i++){
if(line.temparray[i]==element)
return 1;
else
return 0;
}
}
---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site |
|
From: Per W. <pw...@ia...> - 2002-10-27 14:40:14
|
But most proably that wasn't the intention.
The fact that both array and string was sized with max must mean
something... in this case a failed attempt at space for the characters. By
mistake, the declaration instead created a number of pointers.
char *ptr;
char string[max];
ptr = new char[max];
strncpy(ptr,string,max);
ptr[max-1] = '\0';
or instead
string[max-1] = '\0';
ptr = strdup(string);
/Per W
On Sun, 27 Oct 2002, Abhijit Shylanath wrote:
> > got a question:
> > i'd like to copy a char string to a string of pointers but i can't get the
> > code working...and i can't see the result with cout... anyone who can help
> > me??
> > kind regards,
> > senem
>
> > #include <iostream.h>
> > #include <stdlib.h>
> > #include <string.h>
> > #include <stdio.h>
> > #define max 5
> > int main(){
> > char *array[max];
>
> Here, you've just declared an array of pointers. You haven't actually
> allocated memory, so the pointers are not valid. You need to new[] it, like
> so.
>
> array[0] = new char[max];
>
> and so on.
>
> > char string[max];
> > cout<<"enter string :";
> > cin.getline(string,max);
> > strncpy(array[0],string,sizeof(string)/sizeof(char));
> > cout<<array[0];
> > return 0;
> > }
>
> ___________________________________________________________
>
> Abhijit Shylanath
>
> E-mail: mu...@gm... || ibr...@bi...
> Web-site: http://mudeth.tripod.com/
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: ApacheCon, November 18-21 in
> Las Vegas (supported by COMDEX), the only Apache event to be
> fully supported by the ASF. http://www.apachecon.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: Abhijit S. <mu...@gm...> - 2002-10-27 13:33:43
|
> got a question:
> i'd like to copy a char string to a string of pointers but i can't get the
> code working...and i can't see the result with cout... anyone who can help
> me??
> kind regards,
> senem
> #include <iostream.h>
> #include <stdlib.h>
> #include <string.h>
> #include <stdio.h>
> #define max 5
> int main(){
> char *array[max];
Here, you've just declared an array of pointers. You haven't actually
allocated memory, so the pointers are not valid. You need to new[] it, like
so.
array[0] = new char[max];
and so on.
> char string[max];
> cout<<"enter string :";
> cin.getline(string,max);
> strncpy(array[0],string,sizeof(string)/sizeof(char));
> cout<<array[0];
> return 0;
> }
___________________________________________________________
Abhijit Shylanath
E-mail: mu...@gm... || ibr...@bi...
Web-site: http://mudeth.tripod.com/
|
|
From: Abhijit S. <mu...@gm...> - 2002-10-27 13:33:26
|
> I've tried that but its still the same size. Try using UPX, an executable compressor. It should be available at http://www.upx.org/. Otherwise, search on google. ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |
|
From: Abhijit S. <mu...@gm...> - 2002-10-27 13:33:22
|
>Sirs, > > I am having linking problems trying to compile programs with >winsock.h and tangensoft.net/wskfaq is telling me that probably I am >using the wrong library. > > How can I add in my Project Options the wsock32.lib file to build >basic console based C/C++ programs for Tcp/Ip? .lib files are only available on VC++. In Dev (MingW (GCC))), libraries are named as lib*.a (example, libwsock32.a). To use it in your program, simply add -lwsock32 to your command-line (under Project > Project Options > General > Linker Options/Optional Libs or Object Files). All the libraries available can be checked under the dev/lib folder. ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |
|
From: senem b. <sbe...@ya...> - 2002-10-27 12:01:42
|
got a question:
i'd like to copy a char string to a string of pointers but i can't get the code working...and i can't see the result with cout... anyone who can help me??
kind regards,
senem
#include <iostream.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#define max 5
int main(){
char *array[max];
char string[max];
cout<<"enter string :";
cin.getline(string,max);
strncpy(array[0],string,sizeof(string)/sizeof(char));
cout<<array[0];
return 0;
}
---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site |
|
From: Ioannis V. <no...@ho...> - 2002-10-27 07:18:48
|
As i have said a few days ago, Longhorn will provide only a managed API (.NET). Here is some more info from a non-programming newsletter: =20 =20 - New applications and activity centers based on Longhorn's Avalon API, which appears to be an XML-based successor to the Win32 API that current Windows applications use. An example of this new type of application is Display Properties, which presents a vastly different UI from today's simple dialog boxes. In the Longhorn alpha screenshots I've seen, Display Properties is a single-window, task-based application that's similar to XP's User Accounts application. Another example of this type of application is My Hardware, which features a collapsible and graphic view of your PC's hardware divided into categories such as Audio Devices and Input Devices. =20 =20 Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com <http://www.noicys.freeurl.com/>=20 * Alternative URL: http://run.to/noicys =20 |
|
From: B. <ama...@uo...> - 2002-10-26 18:20:59
|
Sirs, I am having linking problems trying to compile programs with winsock.h and tangensoft.net/wskfaq is telling me that probably I am using the wrong library. How can I add in my Project Options the wsock32.lib file to build basic console based C/C++ programs for Tcp/Ip? Available files are only the devc++\lib\wsock32.def and windows\system\wsock32.dll. Do I need to download the wsock32.lib? If I need, the place to indicate it is in the Project Options, Add Object File Option? .lib is the correct extension? and .def and .a? Regards Andr=E9 |
|
From: Per W. <pw...@ia...> - 2002-10-26 15:42:22
|
I just whish that whenever Dev-C++ is run for the first time, it would
display a VERY large text message requiring at least ten mouse clicks to
close.
For pause of cmd programs, insert system("PAUSE");
For help files, do...
There are a couple of questions that arrives a bit more often than others
:-)
/Per W
On Sat, 26 Oct 2002, Hans-J=F6rg Stangor wrote:
> Hi Sivan,
>=20
> >>when i try to run a program the output screen flashes by so fast i can'=
t
> actually >>see the output!
> >>what can i do to make the output screen stay?
>=20
> Before your return statement inside the main() routine insert a
>=20
> system("Pause");
>=20
> statement.
>=20
> Here a short example that should work for you:
>=20
> #include <iostream.h>
> #include <stdlib.h>
>=20
> int main(int argc, char *argv[])
> {
> cout << "Hi there!!!...\r\n";
> system("PAUSE");
> return 0;
> }
>=20
>=20
> >>and another question, why can't the program find "help"?
>=20
> Help is not included but you can use the vUpdate Program
> to load it from the Update-Server. You will find a lot of things
> to download (about 50 single downloads) but most important is
> i guess to get the latest vUpdate Program first (done automatically)
> and afterwards the latest Dev-Cpp, the Help File and the tips for
> the language you have set your IDE to. (Dont wonder if you have to
> update Dev-Cpp immediately after you downloaded it... it is some
> versions behind the current version because of the fast development
> cycle of the code monkeys :-) [And i think you do a fabulous work,
> guys!)
>=20
> The download
> speed depends on the time of day a little i found out... a lot
> of persons seem to update on a regular basis :-)
>=20
> You also should check the Resource Page found on Bloodshed Webpage
> for a lot of useful tutorials. And if you're in search for a free ebook t=
ry
> Thinking in C++ by Bruce Eckel. It's located on www.mindview.net . But
> i posted that already a while back here :-)
>=20
> Hope this helps.
>=20
> Best wishes,
> Hans-J=F6rg (who's also trying to get started with C++)
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.net email is sponsored by: ApacheCon, November 18-21 in
> Las Vegas (supported by COMDEX), the only Apache event to be
> fully supported by the ASF. http://www.apachecon.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
>=20
|
|
From: <hj...@hj...> - 2002-10-26 15:31:22
|
Hi Sivan,
>>when i try to run a program the output screen flashes by so fast i can't
actually >>see the output!
>>what can i do to make the output screen stay?
Before your return statement inside the main() routine insert a
system("Pause");
statement.
Here a short example that should work for you:
#include <iostream.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
cout << "Hi there!!!...\r\n";
system("PAUSE");
return 0;
}
>>and another question, why can't the program find "help"?
Help is not included but you can use the vUpdate Program
to load it from the Update-Server. You will find a lot of things
to download (about 50 single downloads) but most important is
i guess to get the latest vUpdate Program first (done automatically)
and afterwards the latest Dev-Cpp, the Help File and the tips for
the language you have set your IDE to. (Dont wonder if you have to
update Dev-Cpp immediately after you downloaded it... it is some
versions behind the current version because of the fast development
cycle of the code monkeys :-) [And i think you do a fabulous work,
guys!)
The download
speed depends on the time of day a little i found out... a lot
of persons seem to update on a regular basis :-)
You also should check the Resource Page found on Bloodshed Webpage
for a lot of useful tutorials. And if you're in search for a free ebook try
Thinking in C++ by Bruce Eckel. It's located on www.mindview.net . But
i posted that already a while back here :-)
Hope this helps.
Best wishes,
Hans-Jörg (who's also trying to get started with C++)
|