|
From: Dyskolos <dys...@li...> - 2001-02-21 18:16:39
|
Hi Gatis!
My suggestion is to read the book "Thinking in C++" written by Bruce
Eckel, fully downloadable from www.BruceEckel.com (both volume 1 and 2). Go
to the site and follow links.
Hope this help!
Dyskolos
> Message: 1
> From: "Gatis Zvejnieks" <gat...@ya...>
> To: <dev...@li...>
> Date: Wed, 20 Dec 2000 21:17:21 +0200
> Subject: [Dev-C++] help
> Reply-To: dev...@li...
>
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_002C_01C06ACA.3DCF2EA0
> Content-Type: text/plain;
> charset="iso-8859-4"
> Content-Transfer-Encoding: quoted-printable
>
> I just started to use Dev-C++ and can't understand how to write =
> programs. I traid to red the help but it's to har for me. I have no =
> expirience with C++ and allmoust no programming experience. I want to =
> learn it. Please help me. It would be great if somebody could send me =
> some simple programms witch I can study.
> Gatis.
|
|
From: Schedler, K. <Kur...@hi...> - 2001-02-27 18:11:35
|
The problem is that your program executes and ends so quickly that you
probably just don't see it.
try this:
#include <iostream.h>
#include <stdio.h>
int main()
{
cout << "Hello" << endl;
getchar();
return 0;
}
The call to getchar will make your program wait until you hit Enter before
it terminates.
-----Original Message-----
From: Gatis Zvejnieks [mailto:gat...@ya...]
Sent: Wednesday, December 27, 2000 8:19 AM
To: dev...@li...
Subject: [Dev-C++] help
Hi,
I have a big problem with Dev-c++. When I run programms Dev-c++ minimazes
and maximizes. The program is OK but I don't see anything. For e4xample this
program should print on screen "Hello World!" but it runs and ends this
program and it is sad that that the programm has 0 errors. This is Windows
application. What schould change some settings in Dev-c++.
#include <iostream.h>
int main()
{
cout << "Hello World!\n";
return 0;
}
Gatis.
"The sender believes that this E-mail and any attachments were free of any
virus, worm, Trojan horse, and/or malicious code when sent. This message
and its attachments could have been infected during transmission. By
reading the message and opening any attachments, the recipient accepts full
responsibility for taking protective and remedial action about viruses and
other defects. The sender's employer is not liable for any loss or damage
arising in any way from this message or its attachments."
|
|
From: Linda H. <lz...@sp...> - 2001-02-27 19:58:00
|
Gatis,
You could also try adding, before the return, cin.get();
--------------------
----- Original Message -----
From: "Schedler, Kurt" <Kur...@hi...>
To: <dev...@li...>
Sent: Tuesday, February 27, 2001 1:15 PM
Subject: RE: [Dev-C++] help
> The problem is that your program executes and ends so quickly that you
> probably just don't see it.
> try this:
>
> #include <iostream.h>
> #include <stdio.h>
>
> int main()
> {
> cout << "Hello" << endl;
> getchar();
> return 0;
> }
>
> The call to getchar will make your program wait until you hit Enter before
> it terminates.
>
> -----Original Message-----
> From: Gatis Zvejnieks [mailto:gat...@ya...]
> Sent: Wednesday, December 27, 2000 8:19 AM
> To: dev...@li...
> Subject: [Dev-C++] help
>
>
> Hi,
> I have a big problem with Dev-c++. When I run programms Dev-c++ minimazes
> and maximizes. The program is OK but I don't see anything. For e4xample
this
> program should print on screen "Hello World!" but it runs and ends this
> program and it is sad that that the programm has 0 errors. This is Windows
> application. What schould change some settings in Dev-c++.
> #include <iostream.h>
> int main()
> {
> cout << "Hello World!\n";
> return 0;
> }
> Gatis.
>
>
>
> "The sender believes that this E-mail and any attachments were free of any
> virus, worm, Trojan horse, and/or malicious code when sent. This message
> and its attachments could have been infected during transmission. By
> reading the message and opening any attachments, the recipient accepts
full
> responsibility for taking protective and remedial action about viruses and
> other defects. The sender's employer is not liable for any loss or damage
> arising in any way from this message or its attachments."
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Vassili <v.v...@bt...> - 2001-03-01 03:37:59
|
you can also use the getch() function, this function waits for a key to be
pressed before it continues.
#include <stdio.h>
#include <conio.h> /* getch() found here */
int main()
{
/* Some code */
getch();
return;
}
----- Original Message -----
From: "Linda Hohenstein" <lz...@sp...>
To: <dev...@li...>
Sent: Tuesday, February 27, 2001 7:59 PM
Subject: Re: [Dev-C++] help
> Gatis,
>
> You could also try adding, before the return, cin.get();
>
> --------------------
> ----- Original Message -----
> From: "Schedler, Kurt" <Kur...@hi...>
> To: <dev...@li...>
> Sent: Tuesday, February 27, 2001 1:15 PM
> Subject: RE: [Dev-C++] help
>
>
> > The problem is that your program executes and ends so quickly that you
> > probably just don't see it.
> > try this:
> >
> > #include <iostream.h>
> > #include <stdio.h>
> >
> > int main()
> > {
> > cout << "Hello" << endl;
> > getchar();
> > return 0;
> > }
> >
> > The call to getchar will make your program wait until you hit Enter
before
> > it terminates.
> >
> > -----Original Message-----
> > From: Gatis Zvejnieks [mailto:gat...@ya...]
> > Sent: Wednesday, December 27, 2000 8:19 AM
> > To: dev...@li...
> > Subject: [Dev-C++] help
> >
> >
> > Hi,
> > I have a big problem with Dev-c++. When I run programms Dev-c++
minimazes
> > and maximizes. The program is OK but I don't see anything. For e4xample
> this
> > program should print on screen "Hello World!" but it runs and ends this
> > program and it is sad that that the programm has 0 errors. This is
Windows
> > application. What schould change some settings in Dev-c++.
> > #include <iostream.h>
> > int main()
> > {
> > cout << "Hello World!\n";
> > return 0;
> > }
> > Gatis.
> >
> >
> >
> > "The sender believes that this E-mail and any attachments were free of
any
> > virus, worm, Trojan horse, and/or malicious code when sent. This
message
> > and its attachments could have been infected during transmission. By
> > reading the message and opening any attachments, the recipient accepts
> full
> > responsibility for taking protective and remedial action about viruses
and
> > other defects. The sender's employer is not liable for any loss or
damage
> > arising in any way from this message or its attachments."
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Schedler, K. <Kur...@hi...> - 2001-02-27 20:05:12
|
oh yeah, that's a better way.
-----Original Message-----
From: Linda Hohenstein [mailto:lz...@sp...]
Sent: Tuesday, February 27, 2001 12:59 PM
To: dev...@li...
Subject: Re: [Dev-C++] help
Gatis,
You could also try adding, before the return, cin.get();
--------------------
----- Original Message -----
From: "Schedler, Kurt" <Kur...@hi...>
To: <dev...@li...>
Sent: Tuesday, February 27, 2001 1:15 PM
Subject: RE: [Dev-C++] help
> The problem is that your program executes and ends so quickly that you
> probably just don't see it.
> try this:
>
> #include <iostream.h>
> #include <stdio.h>
>
> int main()
> {
> cout << "Hello" << endl;
> getchar();
> return 0;
> }
>
> The call to getchar will make your program wait until you hit Enter before
> it terminates.
>
> -----Original Message-----
> From: Gatis Zvejnieks [mailto:gat...@ya...]
> Sent: Wednesday, December 27, 2000 8:19 AM
> To: dev...@li...
> Subject: [Dev-C++] help
>
>
> Hi,
> I have a big problem with Dev-c++. When I run programms Dev-c++ minimazes
> and maximizes. The program is OK but I don't see anything. For e4xample
this
> program should print on screen "Hello World!" but it runs and ends this
> program and it is sad that that the programm has 0 errors. This is Windows
> application. What schould change some settings in Dev-c++.
> #include <iostream.h>
> int main()
> {
> cout << "Hello World!\n";
> return 0;
> }
> Gatis.
>
>
>
> "The sender believes that this E-mail and any attachments were free of any
> virus, worm, Trojan horse, and/or malicious code when sent. This message
> and its attachments could have been infected during transmission. By
> reading the message and opening any attachments, the recipient accepts
full
> responsibility for taking protective and remedial action about viruses and
> other defects. The sender's employer is not liable for any loss or damage
> arising in any way from this message or its attachments."
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
"The sender believes that this E-mail and any attachments were free of any
virus, worm, Trojan horse, and/or malicious code when sent. This message
and its attachments could have been infected during transmission. By
reading the message and opening any attachments, the recipient accepts full
responsibility for taking protective and remedial action about viruses and
other defects. The sender's employer is not liable for any loss or damage
arising in any way from this message or its attachments."
|
|
From: Brian M. <str...@ho...> - 2002-03-06 22:44:57
Attachments:
Knight's Tour.cpp
KT.exe
|
I don't know anything about stack faults, but i do have a knight's tour program that runs without any kind of illegal operations and doesn't use recursive functions. It also works just about all the time. take a look if you want. >From: "Jason Hardman" <jas...@bt...> >To: "Dev-C++" <dev...@li...>, "Mohammed Riyaz" ><p_m...@ho...> >Subject: Re: [Dev-C++] help >Date: Wed, 6 Mar 2002 16:24:43 -0000 > >I couldn't tell you exactly what the problem is without the seeing the >source code, which I'm interested in doing anyway as it's not a problem >I've >come across before. However I can suggest what may be the cause. By any >chance is the algorithm used a recursive one? That could be one reason you >are getting a 'stack fault' as every time you call a method you are >creating >a new set of instance variables (amongst other things) on the stack for it, >and there is only a limited amount of space allocated to the stack usualy. >Notice that in both versions the stack pointer (ESP) is about 00560000h >which is about 5 Meg assuming it started a zero. I think on intel machines >that is the case? > >There may be another cause but that seems the most likely. If you are using >a recursive function then try to reimplement it in a non-recursive manner, >it will be faster that way too. > >If recursive calls are the cause, then this fault also suggests that there >may be an error in the termination condition of the function(s), so you are >going through an infinite number of recursive calls, although it may just >be >that the algorithm requires so many calls that the termination condition >would never be met before a stack overflow. > >This is all just a stab in the dark without seeing the code, but I hope it >helps. > >Jason > >----- Original Message ----- >From: "Mohammed Riyaz" <p_m...@ho...> >To: <dev...@li...> >Sent: Wednesday, March 06, 2002 7:43 AM >Subject: [Dev-C++] help > > > > > > Hey guys, > > > > i wrote a program to solve the knight's problem.(move to every block on >the > > chess board using the knight's movements, but never reach the same block > > twice.) > > > > I feel though i coded the program right my system is unable to run the > > program. > > > > In order to test it i compiled the program with two compilers, as a >result > > both the exe files gave errors. but the exe file created by dev-c++ >compiler > > ran longer than the other(i.e it could try more to reach the result). > > > > the error message for both theexe files was > > " this program has performed an illegal operation and will be shut down" > > > > but the details causing the error were diffrent in the either case: > > > > When compiled with Dev-c++ compiler: > > > > KNIGHT caused a stack fault in module KERNEL32.DLL at 0167:bff7a2a1. > > Registers: > > EAX=0054fffc CS=0167 EIP=bff7a2a1 EFLGS=00000216 > > EBX=78037780 SS=016f ESP=00552018 EBP=00552024 > > ECX=c1413f00 DS=016f ESI=00000024 FS=4d3f > > EDX=bffc9490 ES=016f EDI=81661bc0 GS=0000 > > Bytes at CS:EIP: > > 58 5f 8b e5 5d c3 a1 e8 9c fc bf 8b 08 ff 41 38 > > Stack dump: > > 81660a14 00000002 c1413f00 00552044 bff75d40 00000002 00000024 78037780 > > bffa0001 81660a14 00000000 00552480 78011eb2 0000000c 0055206c 00000002 > > > > > > > > When compiled with borland v5.5 compiler: > > > > KNIGHT caused a stack fault in module KNI.EXE at 0167:0041557a. > > Registers: > > EAX=00000006 CS=0167 EIP=0041557a EFLGS=00010206 > > EBX=00562018 SS=016f ESP=00562000 EBP=0056205c > > ECX=005624f1 DS=016f ESI=005624f1 FS=4d1f > > EDX=00000000 ES=016f EDI=0000000a GS=0000 > > Bytes at CS:EIP: > > 55 53 56 57 8b 5c 24 14 8b 4c 24 18 0b c9 75 08 > > Stack dump: > > 00415991 0000000a 00000000 00000024 005625e6 00562664 004159a4 0000000a > > 00000000 00000024 005625fe 00562664 00000001 00000020 0056260e 00562664 > > > > > > cud some one tell me what i cud do? > > i didnt use dynamic memory allocation in my program. > > -riyaz > > > > ======================================================================== > > P.Mohammed riyaz > > Student, Computer Science And Engineering > > ======================================================================== > > > > > > _________________________________________________________________ > > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > > > > _______________________________________________ > > 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 _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com |
|
From: Ioannis V. <no...@ya...> - 2002-03-06 22:57:36
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Brian McCall > Sent: Thursday, March 07, 2002 12:45 AM > To: dev...@li... > Subject: Re: [Dev-C++] help > > > I don't know anything about stack faults, but i do have a > knight's tour > program that runs without any kind of illegal operations and > doesn't use > recursive functions. It also works just about all the time. > take a look if > you want. It is empty! Also it doesn't compile. Is that a joke? Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys |
|
From: Jason H. <jas...@bt...> - 2002-03-07 01:17:20
Attachments:
Knight's Tour.cpp
|
I recieved one copy of Brians last e-mail from Dev-C++ and one direct. The one that came direct was complete and works. I'll attach it to this, but I'll leave off the exe as it compiles fine, and I assume the people on the list have a C++ compiler lying around somewhere. :-D Maybe sending files larger than a certain size isn't possible through the mailing list. I assume this is a different copy to the one you have been having the problems with? If you still want help with that then you need to send us some representative code. We don't try to fix code that already works. Jason. ----- Original Message ----- From: "Ioannis Vranos" <no...@ya...> To: "Dev-C++" <dev...@li...> Sent: Wednesday, March 06, 2002 10:57 PM Subject: RE: [Dev-C++] help > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...] On Behalf > > Of Brian McCall > > Sent: Thursday, March 07, 2002 12:45 AM > > To: dev...@li... > > Subject: Re: [Dev-C++] help > > > > > > I don't know anything about stack faults, but i do have a > > knight's tour > > program that runs without any kind of illegal operations and > > doesn't use > > recursive functions. It also works just about all the time. > > take a look if > > you want. > > > It is empty! Also it doesn't compile. Is that a joke? > > > > Ioannis > > * Ioannis Vranos > * Programming pages: http://www.noicys.d2g.com > * Alternative URL: http://run.to/noicys > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Ioannis V. <no...@ya...> - 2002-03-07 01:59:12
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Jason Hardman > Sent: Thursday, March 07, 2002 3:17 AM > To: Dev-C++ > Subject: Re: [Dev-C++] help > > > I recieved one copy of Brians last e-mail from Dev-C++ and > one direct. The one that came direct was complete and works. > I'll attach it to this, but I'll leave off the exe as it > compiles fine, and I assume the people on the list have a C++ Thanks Jason. > compiler lying around somewhere. :-D Maybe sending files > larger than a certain size isn't possible through the mailing list. And then how did i receive it ok from your email? :) > I assume this is a different copy to the one you have been > having the problems with? If you still want help with that > then you need to send us some representative code. We don't > try to fix code that already works. The particular happens to compile but it is not portable (not even guaranteed to compile in the future). And this because it uses preANSI syntax. Also it is written in C style but anyway it is a good job. :) Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys |
|
From: Chris S. <CS...@Ai...> - 2003-10-01 07:54:05
|
I'm glad someone has nipped this one in the bud !!=20 I'm glad to see that this forum is for people to find solutions to = genuine problems they have in using DevC++ or C/C++, and that it's not = being used as a place for people to find ways to get others to do work = for them.=20 :-) -----Original Message----- From: P.D. van Zelst [mailto:pa...@my...] Sent: Wednesday, 1 October 2003 4:14 PM To: 'Chin He Quan'; dev...@li... Subject: RE: [Dev-C++] Re:help Sure, we all love doing other people's homework. Think about this (very simple!) problem just for a second or two and you = can figure it out for yourself. It probably takes you more time to write = this mail and wait for someone who actually sends you such a program than it = does for you to write it yourself. ________________________________ From: dev...@li... [mailto:dev...@li...] On Behalf Of Chin He = Quan Sent: Wednesday, October 01, 2003 4:34 AM To: dev...@li... Subject: [Dev-C++] Re:help =20 I have a problem using Dev-C++ making the following programme: a 4rows = by 5 columns of seats, it must display=20 A1 A2 A3 B1 B2 B3 and so on, when the seats are booked, it will display=20 =20 A1 X A3 X B2 B3 if possible send me the programme for making this. Thank You! ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Ray K. <he...@er...> - 2004-02-25 11:35:00
|
"alf" <al...@bl...> wrote:
> my dos console stays on by putting cin.get() before return 0.
That's because it's waiting for input, and doesn't close before it gets=20
some.
> the windows consoles just blink on then off with or without cin.get().
That's because the program returned, and doesn't have a reason to stay=20
open.
> What should I do?
You should set your email client to plain-text mode, so we don't
have to look at this:
> without cin.get().</FONT></DIV>
> <DIV><FONT face=3D3DArial size=3D3D2>What should I do?</FONT></DIV>
> <DIV><FONT face=3D3DArial size=3D3D2>many thanks =3D
> alf.</FONT></DIV></BODY></HTML>
>
> ------=3D_NextPart_000_0011_01C3FA4F.97A46680--
Then you should either run from a command line, which won't close when yo=
ur
program finishes running, or you should leave cin.get() in.=20
(system("pause");
will work, too, but only on a DOS or DOS derivitive system.)
|
|
From: Ray K. <he...@er...> - 2004-02-25 11:44:30
|
Whoops. I realized I misread your message shortly after I sent my reply.
If the window is closing even with cin.get() in there, it means that=20
there's
probably still something in the stdin file stream, and cin.get() is=20
pulling
that out and then returning. There are a couple of methods that might wor=
k.
1) use system("pause"); (Remember, this isn't portable.)
2) cin.ignore(100,EOF); cin.get();
That will clear up to 100 characters from stdin, and will stop if it=20
reaches
the end of file. Then it will call cin.get(), and this time there=20
shouldn't be
anything left in the stream for it to pull out, so it'll wait for user=20
input.
My advice about not using MIME formatting is still valid.
|