dev-cpp-users Mailing List for Dev-C++ (Page 605)
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: <jul...@er...> - 2002-04-07 20:46:49
|
>>I believe you use a static member function to operate on static data
>>members.
>>e.g.
>>private:
>>static char CompanyName[25];
>>public:
>>static void InitialiseCompanyName(void);
But the problem is the same:
**********File_1.hpp begin**************
template<unsigned number> struct MyVector{
unsigned[number] my_array;
MyVector(void){for(int I=0;I<number;I++) my_array[I]=I;};
//Overload of op= and copy constructor;
};
template<unsigned num> class MyTemplateClass{
static const my_vector<num> MyStaticDataMember;
static InitialiseMyStaticDataMember(void){
MyStaticDataMember=MyVector<num>();}
};
**********File_1.hpp end****************
**********File_1.cpp begin**************
#include "File_1.hpp"
const MyTemplateClass<num>::InitialiseMyStaticDataMember();//¿¿num??
**********File_1.cpp end****************
**********File_Main.cpp begin***********
#include "File_1.hpp"
void main(){
MyTemplateClass<9> WishedObject();
};
**********File_Main.cpp end***********
|
|
From: Daniel G. <sp...@ho...> - 2002-04-07 20:20:43
|
I believe you use a static member function to operate on static data
members.
e.g.
private:
static char CompanyName[25];
public:
static void InitialiseCompanyName(void);
>From: Julián Calderón Almendros <jul...@er...>
>Reply-To: <jul...@er...>
>To: "Dev-C++" <dev...@li...>
>Subject: [Dev-C++] I Need Help On Static Data Member of Template Class
>Date: Sun, 7 Apr 2002 19:10:00 +0200
>
>How Do I Initialize this static data member:
>
>**********File_1.hpp begin**************
>template<unsigned number> struct mi_vector{
> unsigned[number] my_array;
> mi_vector(void){for(int I=0;I<number;I++) my_array[I]=I;}
>};
>template<unsigned num> class MyTemplateClass{
>static const mi_vector<num> MyStaticDataMember;
>};
>**********File_1.hpp end****************
>**********File_1.cpp begin**************
>#include "File_1.hpp"
>const my_vector<num> MyStaticDataMember(num);//¿¿??
>**********File_1.cpp end****************
>**********File_Main.cpp begin***********
>#include "File_1.hpp"
>void main(){
> MyTempClass<9> WishedObject();
>};
>**********File_Main.cpp end***********
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Join the worlds largest e-mail service with MSN Hotmail.
http://www.hotmail.com
|
|
From: <jul...@er...> - 2002-04-07 17:10:04
|
How Do I Initialize this static data member:
**********File_1.hpp begin**************
template<unsigned number> struct mi_vector{
unsigned[number] my_array;
mi_vector(void){for(int I=0;I<number;I++) my_array[I]=I;}
};
template<unsigned num> class MyTemplateClass{
static const mi_vector<num> MyStaticDataMember;
};
**********File_1.hpp end****************
**********File_1.cpp begin**************
#include "File_1.hpp"
const my_vector<num> MyStaticDataMember(num);//¿¿??
**********File_1.cpp end****************
**********File_Main.cpp begin***********
#include "File_1.hpp"
void main(){
MyTempClass<9> WishedObject();
};
**********File_Main.cpp end***********
|
|
From: Ioannis V. <no...@ho...> - 2002-04-07 16:22:33
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Napoleon Ahiable > Sent: Sunday, April 07, 2002 5:36 PM > To: dev...@li... > Subject: Re: [Dev-C++] AMD ATHLON v PENTIUM 4 > > > Hi all, > I am about to get myself a new PC. I have always used Intel > based PC's and > after all that I have heard about AMD ATHLON in terms of > speed (ie faster > than its INTEL competitor) I am tempted to give it a try. I > however want > know if this claim is true and if it has any drawbacks with respect to > programming It is usually faster than equivallent MHz INTEL CPUs (they have the rating to which INTEL CPU are equivallent, e.g. 1800+ etc). You can compare prizes between an AMD "rating-speed" CPU and an Intel CPU to decide. For example an 1800+ AMD CPU has the same overall performance to an INTEL 1800 MHz CPU. So you can buy the cheaper. On the other side, Intel CPUs are the standard. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys Intel on the other side is the standard. |
|
From: Napoleon A. <nah...@so...> - 2002-04-07 15:38:02
|
Hi all, I am about to get myself a new PC. I have always used Intel based PC's and after all that I have heard about AMD ATHLON in terms of speed (ie faster than its INTEL competitor) I am tempted to give it a try. I however want know if this claim is true and if it has any drawbacks with respect to programming Cheers Napleon. |
|
From: Daniel K. O. <dan...@ya...> - 2002-04-07 15:37:19
|
Thanks Evan
It solved the problems with missing headers.
But I'm still having some problems:
2)) Look to this error:
"144 callbacks.c
warning: passing arg 2 of `create_dir_browser' discards qualifiers
from
pointer target type"
Here is the code:
///
/* Function prototype */
7: GtkWidget *create_dir_browser(gchar * title, gchar * current_path,
GtkSelectionMode mode, void (*handler) (gchar *));
124: void on_dir_select29(gchar * dir);
...
141: GtkWidget *win;
142:
143: win = create_dir_browser(_("Select Directory"), g_get_home_dir(),
144: GTK_SELECTION_SINGLE, on_dir_select29);
///
I get this error in many other points too. I have no idea of what to do
(what does the "void (*handler) (gchar *)" mean?).
Well, commenting those lines, it compiles, but then I get linker errors:
c:/projects/lopster/global.o: In function `user2_compare':
//c/projects/lopster/src/global.c:5452: undefined reference to
`inet_network'
c:/projects/lopster/search.o: In function `search_fields_detach':
//c/projects/lopster/src/search.c:2117: undefined reference to
`gtk_window_reposition'
My objects included:
-lgtk.dll -lgdk-win32-2.0.dll -lgmodule-2.0.dll -lgobject-2.0.dll -lglib-2.0
.dll -lwininet -lwsock32 -lgtk-win32-1.3.dll C:\Dev-C++\Lib\gtk.lib
C:\Dev-C++\Lib\gtk-win32-1.3.lib -lc -lmswsock -lgtk-win32-2.0.dll
C:\Dev-C++\Lib\gtk-win32-2.0.lib
Again, thanks for any help.
Daniel K. O.
-----Mensagem original-----
De: dev...@li...
[mailto:dev...@li...]Em nome de Evan Hempel
<ech...@ne...>
Enviada em: sexta-feira, 5 de abril de 2002 16:23
Para: "Dev-Cpp-Users"
Cc: "Daniel K. O."
Assunto: [Dev-C++] Re: 10 quick questions
It looks like you need gtk+ and pw32 (a posix emulation layer)
You can find them at:
Pw32:http://pw32.sourceforge.net/
Gtk+:http://gtk.org (dev-c++ packages at
http://www.bloodshed.net/dev/packages/gtk.html)
I think that these 2 packages would remove most (all?) the errors. But, I
haven't used either - just read some of their docs.
Evan Hempel
PS: I think that there also is a dev-c++ package for pw32
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|
|
From: Ioannis V. <no...@ho...> - 2002-04-07 14:31:14
|
You obviously forgot the '' when you used the char type. '1', '2', '3'. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Daniel Glenfield > Sent: Sunday, April 07, 2002 2:04 PM > To: dev...@li... > Subject: [Dev-C++] Case statement - it SHOULD work... > > > Here's a quick bit of code. For some reason when I enter 1, > 2, or 3 I get > the ERROR!!!!! message. If I change Choice to a char type and > change 1 2 and > 3 to a b and c it works. > What's wrong? > > int main(int argc, char *argv[]) > { > using namespace std; > > int Choice; // Menu choice, as entered by user. > do > { > cout << "***** W E L C O M E *****\n"; > cout << "\nChoose one of the following...\n"; > cout << "1.Create Employee 2.Change wage 3.Exit\n"; > cin >> Choice; // Get user's choice > switch (Choice) // Beginning our case flow control statements > { > case 'a' : cout << "Confirmed - Creating Employee...\n"; > break; > case 'b' : cout << "Confirmed - Changing wage...\n"; > break; > case 'c' : cout << "Exiting...\n"; > break; > default : cout << "ERROR!!!!!!!!!!!!!!!!\n"; > } > }while(Choice > '3' || Choice < '1'); > > > _________________________________________________________________ > 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 > |
|
From: Ioannis V. <no...@ho...> - 2002-04-07 14:26:24
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Daniel Glenfield > Sent: Sunday, April 07, 2002 1:07 PM > To: dev...@li... > Subject: [Dev-C++] difference between char* argv[] and char *argv[] > > > Hi all, > what's the difference between char* argv[] and char *argv[] > ? imilarly, > char* abc and char *abc ? Are they the SAME because the > compiler ignores > whitespace? > > Daniel They are the same. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys |
|
From: Ioannis V. <no...@ho...> - 2002-04-07 14:24:22
|
Or better:
#include <stdlib.h>
system("pause");
Or the best solution that i do, open a permanent console window.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Daniel Glenfield
> Sent: Sunday, April 07, 2002 1:00 PM
> To: jpa...@ya...; dev...@li...
> Subject: Re: [Dev-C++] DOS Window
>
>
> Yes DEV closes as soon as the program has finished. What I do
> to stop this
> is to
> 1) at the start of the code type #include <iostream.h> (I
> know it's not the
> 'proper' way but it will work fine here
> 2) before the end of the program type
> int x;
> cin >> x;
>
> and the program will wait for you to type a number before
> exiting. You may
> like to add cout << "Please type a number to exit\n"; on the
> line above the
> cin statement for other ppl to know how to exit.
>
> Daniel
|
|
From: <h.r...@gm...> - 2002-04-07 13:56:49
|
Hi, I have downloaded dev-c++ 5 beta. All works fine (at w2k), but if I compile a program and there are error messages then the ide outputs the linenumber and the error messages only, but not the unit name. What's wrong ? greetings Horst -- Horst Rößner Postf. 1802 52205 Stolberg ICQ ID #74808448 h.r...@gm... h.g...@t-... GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net |
|
From: <Dan...@ao...> - 2002-04-07 12:51:32
|
In a message dated 4/7/2002 07:04:50 Central Daylight Time,
sp...@ho... writes:
Here's a quick bit of code. For some reason when I enter 1, 2, or 3 I get
the ERROR!!!!! message. If I change Choice to a char type and change 1 2 and
3 to a b and c it works.
What's wrong?
int main(int argc, char *argv[])
{
using namespace std;
int Choice; // Menu choice, as entered by user.
do
{
cout << "***** W E L C O M E *****\n";
cout << "\nChoose one of the following...\n";
cout << "1.Create Employee 2.Change wage 3.Exit\n";
cin >> Choice; // Get user's choice
switch (Choice) // Beginning our case flow control statements
{
case 'a' : cout << "Confirmed - Creating Employee...\n";
break;
case 'b' : cout << "Confirmed - Changing wage...\n";
break;
case 'c' : cout << "Exiting...\n";
break;
default : cout << "ERROR!!!!!!!!!!!!!!!!\n";
}
}while(Choice > '3' || Choice < '1');
You need to change your case statements
from case a' case'b' case 'c' to case '1' case '2' case '3' and the program
will respond according to the menu you've created.
With warmest regards,
Danny
|
|
From: Daniel G. <sp...@ho...> - 2002-04-07 12:49:52
|
Thank you!!!!! That clears up a LOT! It's pretty stupid when course material changes from char* abc to char *abc without telling you they're the same. Thanks!!! >From: h.r...@gm... >To: dev...@li... >Subject: Re: [Dev-C++] difference between char* argv[] and char *argv[] >Date: Sun, 7 Apr 2002 14:07:33 +0200 (MEST) > > > Hi all, > > what's the difference between char* argv[] and char *argv[] ? >Similarly, > > char* abc and char *abc ? Are they the SAME because the compiler ignores > > whitespace? > > > > Daniel > > >it's the same > _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com |
|
From: Jason S. <mys...@op...> - 2002-04-07 12:24:22
|
The following works fine. I'm guessing you were doing something weird in
the switch statement, like saying case '1'.
Jason
int main()
{
using namespace std;
int Choice; // Menu choice, as entered by user.
do
{
cout << "***** W E L C O M E *****\n";
cout << "\nChoose one of the following...\n";
cout << "1.Create Employee 2.Change wage 3.Exit\n";
cin >> Choice; // Get user's choice
switch (Choice) // Beginning our case flow control statements
{
case 1 : cout << "Confirmed - Creating Employee...\n";
break;
case 2 : cout << "Confirmed - Changing wage...\n";
break;
case 3 : cout << "Exiting...\n";
break;
default : cout << "ERROR!!!!!!!!!!!!!!!!\n"; break;
}
}while(Choice > '3' || Choice < '1');
return 0;
}
----- Original Message -----
From: "Daniel Glenfield" <sp...@ho...>
To: <dev...@li...>
Sent: Sunday, April 07, 2002 8:04 AM
Subject: [Dev-C++] Case statement - it SHOULD work...
> Here's a quick bit of code. For some reason when I enter 1, 2, or 3 I get
> the ERROR!!!!! message. If I change Choice to a char type and change 1 2
and
> 3 to a b and c it works.
> What's wrong?
>
-users
|
|
From: <h.r...@gm...> - 2002-04-07 12:07:41
|
> Hi all, > what's the difference between char* argv[] and char *argv[] ? imilarly, > char* abc and char *abc ? Are they the SAME because the compiler ignores > whitespace? > > Daniel > it's the same PS: sorry for PM -- -------------------------- Horst Rößner Postf. 1802 52205 Stolberg GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net |
|
From: Daniel G. <sp...@ho...> - 2002-04-07 12:04:18
|
Here's a quick bit of code. For some reason when I enter 1, 2, or 3 I get
the ERROR!!!!! message. If I change Choice to a char type and change 1 2 and
3 to a b and c it works.
What's wrong?
int main(int argc, char *argv[])
{
using namespace std;
int Choice; // Menu choice, as entered by user.
do
{
cout << "***** W E L C O M E *****\n";
cout << "\nChoose one of the following...\n";
cout << "1.Create Employee 2.Change wage 3.Exit\n";
cin >> Choice; // Get user's choice
switch (Choice) // Beginning our case flow control statements
{
case 'a' : cout << "Confirmed - Creating Employee...\n";
break;
case 'b' : cout << "Confirmed - Changing wage...\n";
break;
case 'c' : cout << "Exiting...\n";
break;
default : cout << "ERROR!!!!!!!!!!!!!!!!\n";
}
}while(Choice > '3' || Choice < '1');
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
|
|
From: <h.r...@gm...> - 2002-04-07 12:03:17
|
> John,
>
> >> Can someone tell me why my DOS windows close on me all the time. I
> cleared the "close on exit" box, but it still closes on me. <<
>
> The simple answer is that is the way windows is designed to function,
> but don't ask me why.
>
> I perfer this method:
> #include <iostream.h>
> #include <conio_mingw.h>
>
> int main()
> {
> /* your code goes here */
>
> while (!kbhit());
> return 0;
> }
> Regards,
>
> Bob
>
Hi,
a other method is:
#include <cstdlib>
int main(int argc, char *argv[])
{
[...]
system("PAUSE");
return 0;
}
regards
Horst
--
--------------------------
Horst Rößner
Postf. 1802
52205 Stolberg
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
|
|
From: Daniel G. <sp...@ho...> - 2002-04-07 11:21:55
|
I'm a little rusty, but are you trying to write a DirectX program? I downloaded the SDK from microsoft (over a 56k modem, it took AGES!) and found I could only get some of the examples to run properly, and had to invest in Visual C++ to write anything more than basic DirectX applications. Daniel >From: "Marcantonio Magnarapa" <mar...@ma...> >To: <dev...@li...> >Subject: [Dev-C++] CoCreateInstance cannot be used. >Date: Sun, 7 Apr 2002 00:07:42 +0200 > >Hi, > >I have specified the -fvtable-thunks directive in the compiler options, and >I have included objbase.h. > >However, when I try to compile, I get: > > C:\cc8adaaa.o(.text+0x2c2):untitl~1.cpp: undefined reference to >`CoUninitialize@0' > >I suppose I should add a reference to ole32.def, but I really cannot tell >how to do it. > >Can you please help me? > >Marcantonio > > >_______________________________________________ >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: Bob W. <bo...@ph...> - 2002-04-07 11:21:18
|
John,
>> Can someone tell me why my DOS windows close on me all the time. I =
cleared the "close on exit" box, but it still closes on me. <<
The simple answer is that is the way windows is designed to function, =
but don't ask me why.=20
I perfer this method:
#include <iostream.h>
#include <conio_mingw.h>
int main()
{
/* your code goes here */
while (!kbhit());
return 0;
}
Regards,
Bob
|
|
From: Daniel G. <sp...@ho...> - 2002-04-07 11:07:44
|
Hi all, what's the difference between char* argv[] and char *argv[] ? imilarly, char* abc and char *abc ? Are they the SAME because the compiler ignores whitespace? Daniel _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com |
|
From: Daniel G. <sp...@ho...> - 2002-04-07 10:59:48
|
Yes DEV closes as soon as the program has finished. What I do to stop this is to 1) at the start of the code type #include <iostream.h> (I know it's not the 'proper' way but it will work fine here 2) before the end of the program type int x; cin >> x; and the program will wait for you to type a number before exiting. You may like to add cout << "Please type a number to exit\n"; on the line above the cin statement for other ppl to know how to exit. Daniel >From: "John Pallas" <jpa...@ya...> >Reply-To: "John Pallas" <jpa...@ya...> >To: <dev...@li...> >Subject: [Dev-C++] DOS Window >Date: Sun, 7 Apr 2002 05:42:39 -0400 > >Can someone tell me why my DOS windows close on me all the time. I cleared >the "close on exit" box, but it still closes on me. > > >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com |
|
From: John P. <jpa...@ya...> - 2002-04-07 09:37:04
|
Can someone tell me why my DOS windows close on me all the time. I cleared the "close on exit" box, but it still closes on me. |
|
From: Marcantonio M. <mar...@ma...> - 2002-04-06 22:08:28
|
Hi, I have specified the -fvtable-thunks directive in the compiler options, = and I have included objbase.h. However, when I try to compile, I get: C:\cc8adaaa.o(.text+0x2c2):untitl~1.cpp: undefined reference to = `CoUninitialize@0' I suppose I should add a reference to ole32.def, but I really cannot = tell how to do it. Can you please help me? Marcantonio |
|
From: Jason H. <jas...@bt...> - 2002-04-06 16:33:22
|
The * is the pointer operator. The program below is pretty bad, because it creates a pointer but
doesn't initialise it to point at anything, and when you get input to it you are writing to
unallocated memory, which could cause a memory access violation.
Books dedicate whole chapters to explaining what a pointer is and how to use them, so I won't here.
char *PName;
or
char* PName;
These two are the same statement really, declaring a pointer to a character or the start of an array
of characters. You should know that a null terminated array of characters in C/C++ represents a C
style string.
char PName;
This just declares a character. Essentialy allocating space for a single character (a byte) which is
why you get only one character from it.
A modified version of your program would be:
#include <iostream>
int main(int argc, char* argv[])
{
using namespace std;
char namebuf[32];
char *PName = namebuf;
cout << "Type passenger name\t";
cin >> PName;
cout << PName;
return 0;
}
Which won't cause any memory errors as long as the name doesn't go over 31 characters (remember 1
char for the null terminator).
Lookup pointers and arrays in your C++ reference of choice.
Jason.
----- Original Message -----
From: "Daniel Glenfield" <sp...@ho...>
To: <dev...@li...>
Sent: Saturday, April 06, 2002 4:37 PM
Subject: [Dev-C++] Very simple Q 'm sure...
Look at the declaration for PName. It is declared as char *PName. The line
cout<<PName; outputs the entire name.
HOWEVER if I declare the variable as char PName (with no *) only the first
letter is outputted.
Can anyone tell me what the * is doing?
Thanks,
Daniel
#include <iostream>
#pragma warning (disable : 4101)
int main(int argc, char* argv[])
{
using namespace std;
char *PName;
cout << "Type passenger name\t";
cin >> PName;
cout << PName;
return 0;
}
_________________________________________________________________
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: Daniel G. <sp...@ho...> - 2002-04-06 15:39:19
|
Hi,
I have seen the main parameters declared as
int main(int argc, char* argv[])
{
return 0;
}
But aren't there meant to be three arguments?
Daniel
_________________________________________________________________
Join the worlds largest e-mail service with MSN Hotmail.
http://www.hotmail.com
|
|
From: Daniel G. <sp...@ho...> - 2002-04-06 15:37:20
|
Look at the declaration for PName. It is declared as char *PName. The line
cout<<PName; outputs the entire name.
HOWEVER if I declare the variable as char PName (with no *) only the first
letter is outputted.
Can anyone tell me what the * is doing?
Thanks,
Daniel
#include <iostream>
#pragma warning (disable : 4101)
int main(int argc, char* argv[])
{
using namespace std;
char *PName;
cout << "Type passenger name\t";
cin >> PName;
cout << PName;
return 0;
}
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
|