|
From: Willz <moa...@nt...> - 2003-06-22 09:20:14
|
I have just yeaterday started to tach myself programming in c++.I was = wondering if after you have compiled a programe and run it how to make = it saty on the screen to view it. I know you can open up the dos prompt and drag it into the box,it then = shows its path at the command line then one click and enter and it = runs.But can it be run and displayed in dev version 4 to stay on the = screen till you close the window down. It is mostlikely an option but with all the terms new to me i aint sure = off what it would be called . Thanks all... Willz |
|
From: Kevin F. <tec...@bt...> - 2003-06-22 10:00:47
|
You could do
#include <stdlib.h>
then
system("PAUSE");
at the end of your main function.
Regards
Kevin.
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Willz
Sent: 22 July 2003 10:21
To: dev...@li...
Subject: [Dev-C++] Beginner help
I have just yeaterday started to tach myself programming in c++.I was
wondering if after you have compiled a programe and run it how to make it
saty on the screen to view it.
I know you can open up the dos prompt and drag it into the box,it then
shows its path at the command line then one click and enter and it runs.But
can it be run and displayed in dev version 4 to stay on the screen till you
close the window down.
It is mostlikely an option but with all the terms new to me i aint sure
off what it would be called .
Thanks all...
Willz
|
|
From: Shane B. <ast...@te...> - 2003-06-22 10:43:27
|
Another common solution to this is a call to the function getc(), which =
waits for the user to press a key, before continueing.
For example:
int main(void)
{
cout << "Hello World!\n";
getc();
}
To use getc(), will require the stdio.h C library, I suppose a similar =
solution is possible with cin, the opposite to cout. Also, the standard =
iostream header is require for cout/cin.
----- Original Message -----=20
From: Kevin Farrows=20
To: dev...@li...=20
Sent: Sunday, June 22, 2003 4:00 AM
Subject: RE: [Dev-C++] Beginner help
You could do
#include <stdlib.h>
then
system("PAUSE");=20
at the end of your main function.
Regards
Kevin.=20
-----Original Message-----
From: dev...@li... =
[mailto:dev...@li...]On Behalf Of Willz
Sent: 22 July 2003 10:21
To: dev...@li...
Subject: [Dev-C++] Beginner help
I have just yeaterday started to tach myself programming in c++.I =
was wondering if after you have compiled a programe and run it how to =
make it saty on the screen to view it.
I know you can open up the dos prompt and drag it into the box,it =
then shows its path at the command line then one click and enter and it =
runs.But can it be run and displayed in dev version 4 to stay on the =
screen till you close the window down.
It is mostlikely an option but with all the terms new to me i aint =
sure off what it would be called .
Thanks all...
Willz
|
|
From: Ricardo A. <ri...@te...> - 2003-06-24 16:10:38
|
Shane Bryldt escribió:
> I suppose a similar solution is possible with cin, the opposite to
> cout.
You can use cin.get()
;)
--
---------------------------------------------------
Ricardo Amores Hernández
ICQ: 19463735
MSN: zheo_ (at) hotmail (dot) es
---------------------------------------------------
|
|
From: <jp...@bo...> - 2003-07-05 19:01:18
|
Recently I decided to start learning C++ again. When I was taking a=20
look at VC++, I've found a piece of code that I have no idea of what it=20
does:
aView::aView() : m_rectEllipse(0,0,2000,-1000){...}
My doubt is at the single ":" operator. I thought it was used just=20
when I'd like to invoke the constructor of a base class through a=20
derived class. But in this case, in the part of the code I've ommited=20
here, m_rectEllipse is a CRect object, member of the aView class. Is=20
there another way to use the ":" operator that I missed?
Juliano
--=20
Visite minha p=E1gina: http://www.jpavel.kit.net
|
|
From: <jp...@bo...> - 2003-07-05 19:34:41
|
Never mind... I've found it on the net. It can be also used to=20
initialize contained objetcts of a class... Is that right?
Juliano
Juliano P=E1vel Brasil Cust=F3dio wrote:
> Recently I decided to start learning C++ again. When I was taking a=20
> look at VC++, I've found a piece of code that I have no idea of what=20
> it does:
>
> aView::aView() : m_rectEllipse(0,0,2000,-1000){...}
>
> My doubt is at the single ":" operator. I thought it was used just=20
> when I'd like to invoke the constructor of a base class through a=20
> derived class. But in this case, in the part of the code I've ommited=20
> here, m_rectEllipse is a CRect object, member of the aView class. Is=20
> there another way to use the ":" operator that I missed?
>
> Juliano
>
>
--=20
Visite minha p=E1gina: http://www.jpavel.kit.net
|
|
From: Nathan S. <cat...@do...> - 2003-07-06 03:11:42
|
Yes the ':' operator in this instance just defines the initialization lis=
t.
Init lists can be used on any form of constructor to my knowledge, not ju=
st
for composed classes. Hence, they can be used to initialize data members =
of
that object.
Nathan.
----- Original Message -----
From: "Juliano P=E1vel Brasil Cust=F3dio" <jp...@bo...>
To: <dev...@li...>
Sent: Sunday, July 06, 2003 5:34 AM
Subject: [Dev-C++] Re: ":" Operator
Never mind... I've found it on the net. It can be also used to
initialize contained objetcts of a class... Is that right?
|
|
From: Graham D. <g.d...@nt...> - 2003-07-05 19:45:46
|
It's not an operator, it starts the member intialiser list. This can be
used to intialise both the base class and member variables. e.g.
class bar
{
public:
bar(int i) : barmember(i) {}
private:
int barmember;
};
class foo : public bar
{
public:
foo(int i) : bar(i), foomember(10) {}
private:
int foomember;
};
Juliano Pável Brasil Custódio wrote:
> Recently I decided to start learning C++ again. When I was taking a
> look at VC++, I've found a piece of code that I have no idea of what
> it does:
>
> aView::aView() : m_rectEllipse(0,0,2000,-1000){...}
>
> My doubt is at the single ":" operator. I thought it was used just
> when I'd like to invoke the constructor of a base class through a
> derived class. But in this case, in the part of the code I've ommited
> here, m_rectEllipse is a CRect object, member of the aView class. Is
> there another way to use the ":" operator that I missed?
>
> Juliano
>
>
|