dev-cpp-users Mailing List for Dev-C++ (Page 276)
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: Kevin B. <tec...@ne...> - 2003-12-28 06:54:58
|
Operators may not be overloaded for built-in types, for reasons that are fairly clear if you pause to consider the implications. In this case, you are attempting to fundamentally change the meaning of the expression. You might think of char* as a "string", but C++ thinks of it as a pointer. s1 == s2 compares the address values contained in the pointer itself, not the strings they point to. You are asking it for a radical change in behavior. Consider the potential for mischief allowing this sort of thing would cause. C++ already has enough minefields. The whole point of operator overloading is to make the resulting code more clear in its intent. Your attempt not only obfuscates the resulting code, since you are actually attempting to compare not the pointers but the null-terminated char arrays they reference, and furthermore lays a booby-trap for anybody hoping to maintain the code thereafter who foolishly assumes they can tell if two variables are pointing to the same location by using the == operator. And so, such things are illegal. It is allowed for custom types, since there are no preexisting assumptions about how such types should behave as there would be with, say, int or bool. Even so, operator overloading used to excess can quickly make code practically unmaintainable. You need to use a string class with the (char *) and == operators overloaded in the way you desire. The standard library already provides such a class, std::String. You can do exactly what you want with no further coding required like so: String( s1) == String( s2 ). Of course, using String to hold your strings in the first place would eliminate a lot of temporaries. I question what you would be accomplishing by the foregoing maneuver. Or, you could make your own lightweight struct with the necessary operators and constructors. But honestly, if you can't or don't want to use std::String from the start, is reading strcmp really so bad? Why confuse the situation and introduce potential bugs and maintenance headaches just so you can use == and save a few keystrokes? If the use of a real string class is unpalatable, I strongly suggest sticking with the strcmp method, since anybody reading it will most certainly understand what is going on, whereas your attempts at operator magic will likely just confuse the situation. Refactor when it produces a measurable benefit, not just because you can. If you must refactor this code, refactor to use std::String instead of char* altogether, rather than just worrying about the compare operation. --- Kevin |
|
From: Maya <Esc...@ne...> - 2003-12-28 05:21:59
|
This is my first 'class template', so I am sure I am doing something
wrong. Can anyone help?
TIA
------ file.H ------
namespace jme{
template<class K, class D>
class Index{
protected:
K Key;
D Data;
public:
// C'tor
Index(K kx, D dx);
~Index();
};
}
------ file.C ------
template<class K, class D>
jme::Index<K,D>::Index(K kx, D dx){
Key = kx;
Data = dx;
}
template<class K, class D>
jme::Index<K,D>::~Index(){ }
------ main.C ------
int main(){
int i = 50;
std::string name("Maya");
jme::Index<int, std::string> ndx(i,name);
return 0;
}
------ Error message ------
main.o(.text+0xb9):main.C: undefined reference to `jme::Index<int,
std::string>::Index(int, std::string)'
main.o(.text+0x12c):main.C: undefined reference to `jme::Index<int,
std::string>::~Index()'
main.o(.text+0x152):main.C: undefined reference to `jme::Index<int,
std::string>::~Index()'
--
FYI
http://www.astro.umd.edu/~marshall/abbrev.html
E-Mail Policy
http://www.vif.com/users/escalante/Email_Policy.html
|
|
From: Tom C. <jat...@gm...> - 2003-12-27 18:10:12
|
Are you running an anti-virus program? I had to disable Norton when compiling or the entire system would crash. I've since changed to McAfee and have to disable that too, or my floppy drive is repeatedly scanned for a disk. I too am using WinME. --Tom ----- Original Message ----- From: "Russell Schiwal" <rsc...@ya...> To: <dev...@li...> Sent: Thursday, December 25, 2003 9:23 AM Subject: [Dev-C++] MAJOR bug > I have repeatedly downloaded the new beta version of Dev-cpp and have yet you be able to complete a compile. Every time I try to compile my entire system fails, and it is always at the same time: less than one second after I hit the compile command. > I have even gone as far as substituting the old compiler, g++, gcc, make, etc files to see if that would help, but to no avail. > I am running an AMD Duron 750 MHZ with Windows ME and over 500 megs of ram. > Version 4 wasn't perfect, but it worked fine. > Please help. > Sincerely, > Russell Schiwal > > > --------------------------------- > Do you Yahoo!? > Yahoo! Photos - Get your photo on the big screen in Times Square |
|
From: Abdelkader G. <go...@li...> - 2003-12-27 17:36:50
|
To have the code presented above compiling, you should try this:
--------------------------------------------------------------
#include <iostream>
#include <stdlib.h>
using namespace std;
//encapsulate the int type inside a
//structure
typedef struct
{
const int value;
} _int;
//the operator is now defined
//for the structure _int
bool operator==(const _int i,const _int j)
{
cout << "hello" <<endl;
return (i.value + j.value);
}
int main(int argc, char *argv[])
{
_int i = {1};
_int j = {-1};
cout << (i == j) <<endl;
return 0;
}
---------------------------------------------------
The output is:
hello
0
kind regards,
> hi there,
>
> Are you sure that you can overload operator for simple types that are
> not classes? You can emulate built in types operators for you
> defined 'classes', but I'm not sure that you can redefine operator for
> built in types and if this is allowed what a catastrophy it would be ,)
> imagine this (bogus) code:
>
> bool operator==(const int i,const int j)
> {
> return (bool) (i + j);
> }
> //this code change the semantics of ==
> // 4 == -4 -> true 4 == 4 ->false
>
> If you are allowed to change the definition of the == (int equals) this
> means that this operator is changed for 'all' int == operation, so can
> you imagine what happends if you include others source code that have
> used another semantics for the (int ==).
>
> So, I'm not sure that you can overload built in types but if you have
> more information I'm interested ,)
>
> Kind regards;
>
>> Ok here is my dilema.
>>
>> Scattered throught my code is the following line:
>>
>> if(!strcmp(var1,var2))
>> ....
>>
>> What would be the best way to change that to
>>
>> if( var1 == var2 )
>> ....
>>
>> So far here is some exaple code that illustrates my problem:
>> bool operator==(char *s1, char *s2)
>> {
>> if(!strcmp(s1,s2))
>> return true;
>> else
>> return false;
>> }
>>
>> int main()
>> {
>> char x[10] = "Hello";
>> char y[10] = "Hello";
>> if(x == y)
>> cout << "Equal" << endl;
>> else
>> cout << "Not equal" << endl;
>> cin.get();
>> return 0;
>> }
>>
>> Error:
>> C:/Documents and Settings/David/My Documents/scratch.cpp:9: `bool
>> operator==(char*, char*)' must have an argument of class or
>> enumerated type
>>
>> What does it mean?? I have done operator overloading with various
>> classes but I can't get it to work with char *, please help. There is
>> no one to make it a friend with so that is ruled out.
>>
>> =====
>> Signed
>> David Mcken
>>
>> Life Sucks
>> Live with it
>>
>> __________________________________
>> Do you Yahoo!?
>> New Yahoo! Photos - easier uploading and sharing.
>> http://photos.yahoo.com/
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: IBM Linux Tutorials.
>> Become an expert in LINUX or just sharpen your skills. Sign up for
>> IBM's Free Linux Tutorials. Learn everything from the bash shell to
>> sys admin. Click now!
>> http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
>> _______________________________________________
>> 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
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for
> IBM's Free Linux Tutorials. Learn everything from the bash shell to
> sys admin. Click now!
> http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> 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: Abdelkader G. <go...@li...> - 2003-12-27 17:13:40
|
hi there,
Are you sure that you can overload operator for simple types that are not
classes? You can emulate built in types operators for you
defined 'classes', but I'm not sure that you can redefine operator for
built in types and if this is allowed what a catastrophy it would be ,)
imagine this (bogus) code:
bool operator==(const int i,const int j)
{
return (bool) (i + j);
}
//this code change the semantics of ==
// 4 == -4 -> true 4 == 4 ->false
If you are allowed to change the definition of the == (int equals) this
means that this operator is changed for 'all' int == operation, so can you
imagine what happends if you include others source code that have used
another semantics for the (int ==).
So, I'm not sure that you can overload built in types but if you have more
information I'm interested ,)
Kind regards;
> Ok here is my dilema.
>
> Scattered throught my code is the following line:
>
> if(!strcmp(var1,var2))
> ....
>
> What would be the best way to change that to
>
> if( var1 == var2 )
> ....
>
> So far here is some exaple code that illustrates my problem:
> bool operator==(char *s1, char *s2)
> {
> if(!strcmp(s1,s2))
> return true;
> else
> return false;
> }
>
> int main()
> {
> char x[10] = "Hello";
> char y[10] = "Hello";
> if(x == y)
> cout << "Equal" << endl;
> else
> cout << "Not equal" << endl;
> cin.get();
> return 0;
> }
>
> Error:
> C:/Documents and Settings/David/My Documents/scratch.cpp:9: `bool
> operator==(char*, char*)' must have an argument of class or
> enumerated type
>
> What does it mean?? I have done operator overloading with various
> classes but I can't get it to work with char *, please help. There is
> no one to make it a friend with so that is ruled out.
>
> =====
> Signed
> David Mcken
>
> Life Sucks
> Live with it
>
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for
> IBM's Free Linux Tutorials. Learn everything from the bash shell to
> sys admin. Click now!
> http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> 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: Damien A <g_...@ho...> - 2003-12-27 16:48:07
|
<html><div style='background-color:'><DIV class=RTE>
<P><BR></P>
<P>You could change your code to use C++ strings instead of char*. That way, you
<DIV>wouldn't have to write your own == function, as it is one of the methods of the C++ string class. </DIV>
<DIV> </DIV>
<DIV>#include <iostream><BR>#include <string><BR>using namespace std;<BR>int main()<BR>{ <BR> string x = "Hello";<BR> string y = "Hello";<BR> if(x == y)<BR> cout << "Equal" << endl;<BR> else<BR> cout << "Not equal" << endl;<BR> cin.get();<BR> return 0;<BR>}</DIV>
<P></P>
<P><BR></P></DIV>
<DIV></DIV>>From: David McKen <CI...@YA...>
<DIV></DIV>>Reply-To: ci...@ya...
<DIV></DIV>>To: Dev-C Mailing List <DEV...@LI...>
<DIV></DIV>>Subject: [Dev-C++] Operator overloading for built in types.
<DIV></DIV>>Date: Sat, 27 Dec 2003 06:37:31 -0800 (PST)
<DIV></DIV><mailto:dev...@li...?subject=unsubscribe><mailto:dev...@li...><mailto:dev...@li...?subject=help><mailto:dev...@li...?subject=subscribe>
<DIV></DIV>>
<DIV></DIV>>Ok here is my dilema.
<DIV></DIV>>
<DIV></DIV>>Scattered throught my code is the following line:
<DIV></DIV>>
<DIV></DIV>>if(!strcmp(var1,var2))
<DIV></DIV>>....
<DIV></DIV>>
<DIV></DIV>>What would be the best way to change that to
<DIV></DIV>>
<DIV></DIV>>if( var1 == var2 )
<DIV></DIV>>....
<DIV></DIV>
<P>
<DIV> </DIV></P></mailto:dev...@li...?subject=subscribe></mailto:dev...@li...?subject=help></mailto:dev...@li...></mailto:dev...@li...?subject=unsubscribe></div><br clear=all><hr>Add photos to your messages with <a href="http://g.msn.com/8HMAEN/2749??PS=">MSN 8. </a> Get 2 months FREE*.</html>
|
|
From: Kurt W. <km...@ro...> - 2003-12-27 16:44:51
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of David > McKen > Sent: Saturday, December 27, 2003 8:38 AM > To: Dev-C Mailing List > Subject: [Dev-C++] Operator overloading for built in types. > > > Ok here is my dilema. > > Scattered throught my code is the following line: > > if(!strcmp(var1,var2)) Not to be a dick, but why are you using char arrays as strings in C++ anyway? Kurt Weber |
|
From: David M. <ci...@ya...> - 2003-12-27 14:37:37
|
Ok here is my dilema.
Scattered throught my code is the following line:
if(!strcmp(var1,var2))
....
What would be the best way to change that to
if( var1 == var2 )
....
So far here is some exaple code that illustrates my problem:
bool operator==(char *s1, char *s2)
{
if(!strcmp(s1,s2))
return true;
else
return false;
}
int main()
{
char x[10] = "Hello";
char y[10] = "Hello";
if(x == y)
cout << "Equal" << endl;
else
cout << "Not equal" << endl;
cin.get();
return 0;
}
Error:
C:/Documents and Settings/David/My Documents/scratch.cpp:9: `bool
operator==(char*, char*)' must have an argument of class or
enumerated type
What does it mean?? I have done operator overloading with various
classes but I can't get it to work with char *, please help. There is
no one to make it a friend with so that is ruled out.
=====
Signed
David Mcken
Life Sucks
Live with it
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
|
|
From: Kurt W. <km...@ro...> - 2003-12-27 08:24:56
|
Using Dev-C++ 4.9.8.5, compiliation does not result in error messages being displayed to the error-message area at the bottom of the screen. I know error messages should be there because I get them when I compile from the command line, but for some reason they are not appearing at the bottom of the Dev-C++ window. Kurt Weber |
|
From: Michael C U. <mu...@cb...> - 2003-12-27 02:12:09
|
On Sat, 27 Dec 2003, [ISO-8859-1] OROSZI Bal=E1zs wrote: > Because then the variables will be inside the CASE, not in the SWITCH, > and they only get allocated, if that specific CASE is selected, not > every time the program enters the SWITCH. Ah. Ok. I see now. I thought the compiler would just ignore it because if CASE was false, the statements inside that case statement wouldn't even be evaluated. But, yes. I see what happens now. It won't even compile without the braces if they are declarations inside the case. > > -- > Greetings, > Bal=E1zs > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=3D1278&alloc_id=3D3371&op=3Dclick > _______________________________________________ > 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: <or...@vp...> - 2003-12-27 00:43:21
|
Michael C Urban wrote:
>>And about that { } braces inside the case: it is needed because
>>variables are declared inside the case, and they need to be kept in the
>>scope of the case statement, and that can only be achieved by creating a
>>block inside it.
>
>
> But the variables will go out of scope when the break or return statement
> is encountered won't they? Because the entire select block is enclosed in
> braces, so they variables will be local to the select block. Once the
> select block has exited, the variables should go out of scope shouldn't
> they?
>
> So given that, I don't see why the braces are necessary enclosing the
> case.
Because then the variables will be inside the CASE, not in the SWITCH,
and they only get allocated, if that specific CASE is selected, not
every time the program enters the SWITCH.
--
Greetings,
Balázs
|
|
From: Michael C U. <mu...@cb...> - 2003-12-26 21:25:20
|
> And about that { } braces inside the case: it is needed because
> variables are declared inside the case, and they need to be kept in the
> scope of the case statement, and that can only be achieved by creating a
> block inside it.
But the variables will go out of scope when the break or return statement
is encountered won't they? Because the entire select block is enclosed in
braces, so they variables will be local to the select block. Once the
select block has exited, the variables should go out of scope shouldn't
they?
So given that, I don't see why the braces are necessary enclosing the
case.
|
|
From: Hossein H. <ult...@em...> - 2003-12-26 18:43:11
|
Hi Maya,
Sorry if a little bit late!
> Can someone please help me?
> I am using an enum type that I want to store in a std::IOStream object,
> but the compiler [complainer] tells me that the format is not supported.
> enum types are the same as 'const int' right?
Nope! They are not. I checked the Standard and found out that,
in Section 7.2 (Enumeration Decleration) #5, it says that the
underlying type of an enumeration is an integeral type that is
implementation-specific. It doesn't mention anything about
whether it is a const-qualified type or not. Nor does it mention
anything about whether there must be just one candidate
underlying type for a given enum type or are two or more
candidates possible as well.
> namespace jme{
> enum account_t {Zero, One, Two};
> class Account{
> protected:
> account_t type;
>
> ....
> public:
> friend std::istream&
> jme::operator>>(std::istream& is, jme::Account& obj){
> is >> obj.type; // <<======== Here is the problem ****
> return is;
> }
> };
> }
> This gives me an error that reads:
> ====================================================
> account.H: In function `std::istream& jme::operator>>(std::istream&,
> jme::Account&)':
> account.H:91: no match for `std::basic_istream<char,
> std::char_traits<char> >&
> >> jme::account_t&' operator <<<<<<<====== This is the problem *****
> ...: candidates are:
>
> /* Gives me a list of other candidates */
>
> ====================================================
Considering the above citations from the Standard, it seems that
your compiler has found itself not knowing which type to choose
as the underlying type. I think the best solution is to choose
one and clarify it in a way that the compiler understands it.
Furthermore, that long error comment from your compiler is just
'cause it's trying to use the default streaming tools.
Regards,
--Hossein
--
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
|
|
From: Maya <Esc...@ne...> - 2003-12-26 14:52:52
|
namespace Merry{
class Christmas{
public:
// This line is fine!
static const std::ios_base::openmode To_all = std::ios_base::in;
// The below line triggers an error ?
static const std::ios_base::openmode To_Ya =
std::ios_base::out | std::ios_base::app;
protected:
///Bla, bla, bla
};
}
Gives me the following error:
finelname:line: field initializer is not constant
Why is it that 'Merry::Christmas::To_all' is a prblem for the compiler,
but 'Merry::Christmas::To_Ya' is otherwise?
Anybody?
By the way, what I want is to have access to those variables from
another program, using the scope specifiers, will that do the trick?
--
FYI
http://www.astro.umd.edu/~marshall/abbrev.html
E-Mail Policy
http://www.vif.com/users/escalante/Email_Policy.html
* You cannot exercise your power to a point of humiliation.
- Jean Chretien
* The media's the most powerful entity on earth. They have the
power to make the innocent guilty and to make the guilty
innocent, and that's power.
- Malcom X
* "Innocent until proven guilty", no... not in Canada!!
|
|
From: <age...@co...> - 2003-12-26 01:46:58
|
Obviously, tell people not to use poor footers. If your ISP e-mail client has signatures, use them. Comcast provides signatures which do the same thing. The Scott Simontis, Programmer thing at the bottom is a signature. And, I can store 3. However, when people try to use HTML in messages (a wonderful thing gone terribly wrong.) Also, some third-party mail apps might have problems. -- ~~Scott Simontis~~ Programmer > Hi > I've been getting many emails from the group in recent months which arrive > empty, my IT dept has tried to find out the cause since they seem to get to > the group host site OK & I have had the following response: > > > -----Original Message----- > From: SurfControl UK/EMEA Tech Support (CO) [mailto:su...@Su...] > > Sent: 19 December 2003 16:48 > To: 'Jason Walker' > Subject: RE: empty emails > > Hi Jason, > > We have been investigating the issue that you have reported regarding the > message body being removed by the email filter. This issue is being caused > because the footer that is being applied to the message by the sender. The > footer is outside the defined boundaries of the message, this causes the > email filter to enclose the footer within the last boundary thus when the > message is viewed it reads the footer as the message body. Would it be > possible to ask the sender not to apply the footer or to enclose the footer > in the message body and not outside the boundary? > > Regards, > Ian > > -------------------- > > > > Has anyone else had problems of the same sort or know a fix ? > Best regards & seasonal greeting to all. > Mark > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.552 / Virus Database: 344 - Release Date: 15/12/2003 > > > > The information contained in this e-mail message (and any attachment > transmitted herewith) is privileged and confidential and is intended for the > exclusive use of the addressee(s). If you are not an addressee, any > disclosure, reproduction, distribution or other dissemination or use of this > communication is strictly prohibited. If you have received this > communication in error, please contact us immediately so that we can correct > the error. > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > 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: Damien A <g_...@ho...> - 2003-12-25 21:02:32
|
<html><div style='background-color:'><DIV class=RTE>
<P><BR><BR></P></DIV>
<DIV></DIV>>From: "Noorez Kassam" <COO...@HO...>
<DIV></DIV>>To: dev...@li...
<DIV></DIV>>Subject: [Dev-C++] WinAPP
<DIV></DIV>>Date: Wed, 24 Dec 2003 14:11:53 -0700
<DIV></DIV>
<P>>MIME-Version: 1.0 </P>
<P> </P>
<DIV></DIV><mailto:dev...@li...?subject=unsubscribe><mailto:dev...@li...><mailto:dev...@li...?subject=help><mailto:dev...@li...?subject=subscribe>
<DIV></DIV>>My windows APP is closing before i see any results! It complies fine
<DIV></DIV>>but it just closes
<DIV></DIV>>
<DIV></DIV>
<DIV></DIV>> WNDCLASSEX wndClass;
<DIV></DIV>>
<DIV></DIV>> //register class
<DIV></DIV>> wndClass.style = 0;
<DIV></DIV>> wndClass.lpfnWndProc = WindowProc;
<DIV></DIV>> wndClass. cbClsExtra = 0;
<DIV></DIV>> wndClass.hInstance = hInstance;
<DIV></DIV>> wndClass.hIcon = LoadIcon( hInstance, szAppName);
<DIV></DIV>> wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
<DIV></DIV>> wndClass.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
<DIV></DIV>> wndClass.lpszMenuName = NULL;
<DIV></DIV>> wndClass.lpszClassName = szAppName;
<DIV></DIV>> wndClass.hIconSm = wndClass.hIcon;
<DIV></DIV>>
<DIV></DIV>
<DIV></DIV>
<P>Hmm, do you have a resource file that actually has the specified icon? But anyways, the reason your app fails is because RegisterClassEx returns 0. The reason for this prolly were: cbWndExtra was not initialized, and more importantly: cbSize was not initialized/set to the size of the WNDCLASSEX structure. </P>
<P>I changed your code to this:</P>
<P>WNDCLASSEX wndClass = {0}; </P>
<P>//register class <BR>wndClass.style = CS_OWNDC; // A habit I picked up from OpenGL<BR>wndClass.lpfnWndProc = WindowProc; </P>
<P>wndClass.hInstance = hInstance; <BR>wndClass.hIcon = LoadIcon( NULL, IDI_WINLOGO); //A standard windows icon<BR>wndClass.hCursor = LoadCursor(NULL, IDC_ARROW); <BR>wndClass.hbrBackground = (HBRUSH) COLOR_BACKGROUND; <BR>wndClass.lpszMenuName = NULL; <BR>wndClass.lpszClassName = szAppName; <BR>wndClass.hIconSm = wndClass.hIcon; <BR>wndClass.cbSize = sizeof(WNDCLASSEX); //Important field</P>
<P>and it worked ;).</P>
<P>>_________________________________________________________________ </P>
<DIV></DIV>>MSN 8 with e-mail virus protection service: 2 months FREE*
<DIV></DIV>>http://join.msn.com/?page=features/virus&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>-------------------------------------------------------
<DIV></DIV>>This SF.net email is sponsored by: IBM Linux Tutorials.
<DIV></DIV>>Become an expert in LINUX or just sharpen your skills. Sign up for
<DIV></DIV>>IBM's
<DIV></DIV>>Free Linux Tutorials. Learn everything from the bash shell to sys
<DIV></DIV>>admin.
<DIV></DIV>>Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
<DIV></DIV>>_______________________________________________
<DIV></DIV>>Dev-cpp-users mailing list
<DIV></DIV>>Dev...@li...
<DIV></DIV>>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
<DIV></DIV>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
<DIV></DIV></mailto:dev...@li...?subject=subscribe></mailto:dev...@li...?subject=help></mailto:dev...@li...></mailto:dev...@li...?subject=unsubscribe></div><br clear=all><hr>MSN 8 helps <a href="http://g.msn.com/8HMAEN/2752??PS=">ELIMINATE E-MAIL VIRUSES.</a> Get 2 months FREE*.</html>
|
|
From: <or...@vp...> - 2003-12-25 21:01:17
|
Hi!
You left out 2 members of your wndclass structure.
wndClass.cbWndExtra = 0;
wndClass.cbSize = sizeof(WNDCLASSEX);
And about that { } braces inside the case: it is needed because
variables are declared inside the case, and they need to be kept in the
scope of the case statement, and that can only be achieved by creating a
block inside it.
--
Greetings,
Balázs
|
|
From: Michael C U. <mu...@cb...> - 2003-12-25 17:38:12
|
Hmm.. Can you post a sample? Because you shouldn't need to use braces to brace case statments (note that you DO need to use braces around the entire switch block though). But basically, the break statement should break out of the entire switch block, not just the current case. On Thu, 25 Dec 2003, [ISO-8859-1] Carlos Garc=EDa del Monte wrote: > Not for me. When I don't put the braces, the next case is performed, no > matter there is a break; > > > Also. note that the braces around the code in your WM_PAINT case are not > > >necessary. You don't need to use braces to group case statements as all = of > >hem will execute up until it encounters a break or return. > > > > > > > > > > |
|
From: <ce...@te...> - 2003-12-25 17:21:01
|
Not for me. When I don't put the braces, the next case is performed, no matter there is a break; Also. note that the braces around the code in your WM_PAINT case are not >necessary. You don't need to use braces to group case statements as all of >hem will execute up until it encounters a break or return. > > > > |
|
From: Maya <Esc...@ne...> - 2003-12-25 11:35:02
|
See this: http://www.vif.com/users/escalante/tricks_of_the_trade.html > > > _________________________________________________________________ > Add photos to your messages with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=dept/features&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > 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 -- FYI http://www.astro.umd.edu/~marshall/abbrev.html E-Mail Policy http://www.vif.com/users/escalante/Email_Policy.html * You cannot exercise your power to a point of humiliation. - Jean Chretien * The media's the most powerful entity on earth. They have the power to make the innocent guilty and to make the guilty innocent, and that's power. - Malcom X * "Innocent until proven guilty", no... not in Canada!! |
|
From: P.T. W. M. <pt...@ea...> - 2003-12-25 10:12:09
|
I'd recommend two things:
a) Uninstall, re-download, re-install. // Rule out bad
download
b) Visit http://housecall.antivirus.com // Rule out a virus
Patrick
At 01:23 25-12-03, Russell Schiwal wrote:
>I have repeatedly downloaded the new beta version of Dev-cpp and have yet
>you be able to complete a compile. Every time I try to compile my entire
>system fails, and it is always at the same time: less than one second
>after I hit the compile command.
>I have even gone as far as substituting the old compiler, g++, gcc, make,
>etc files to see if that would help, but to no avail.
>I am running an AMD Duron 750 MHZ with Windows ME and over 500 megs of ram.
> Version 4 wasn't perfect, but it worked fine.
>Please help.
>Sincerely,
>Russell Schiwal
>
>
>Do you Yahoo!?
>Yahoo! Photos -
><http://us.rd.yahoo.com/evt=21486/*http://f1.pg.photos.yahoo.com/ph//spsimplenol?.file=ny_ts_splash.html>Get
>your photo on the big screen in Times Square
|
|
From: Russell S. <rsc...@ya...> - 2003-12-25 09:23:06
|
I have repeatedly downloaded the new beta version of Dev-cpp and have yet you be able to complete a compile. Every time I try to compile my entire system fails, and it is always at the same time: less than one second after I hit the compile command. I have even gone as far as substituting the old compiler, g++, gcc, make, etc files to see if that would help, but to no avail. I am running an AMD Duron 750 MHZ with Windows ME and over 500 megs of ram. Version 4 wasn't perfect, but it worked fine. Please help. Sincerely, Russell Schiwal --------------------------------- Do you Yahoo!? Yahoo! Photos - Get your photo on the big screen in Times Square |
|
From: Michael C U. <mu...@cb...> - 2003-12-24 23:27:26
|
Hi Noorez,
The problem is in your switch structure. Your callback function doesn't
return a value from WM_PAINT. Replace the break statement at the end of
your case with a "return 0" statement, and I think that might fix your
problem.
Also. note that the braces around the code in your WM_PAINT case are not
necessary. You don't need to use braces to group case statements as all of
hem will execute up until it encounters a break or return.
Try replacing "break" with "return 0;" and also removing the braces from
the WM_PAINT case. That might fix your problem.
On Wed, 24 Dec 2003, Noorez Kassam wrote:
> This WinApp closes too fast to see results
>
> #include <windows.h>
>
>
> LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsgId, WPARAM wParam, LPARAM
> lParam);
>
> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
> pszCmdLine, int nCmdShow)
> {
> static char szAppName[] = "hello";
> HWND hWnd;
> MSG msg;
> WNDCLASSEX wndClass;
>
> //register class
> wndClass.style = 0;
> wndClass.lpfnWndProc = WindowProc;
> wndClass. cbClsExtra = 0;
> wndClass.hInstance = hInstance;
> wndClass.hIcon = LoadIcon( hInstance, szAppName);
> wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
> wndClass.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
> wndClass.lpszMenuName = NULL;
> wndClass.lpszClassName = szAppName;
> wndClass.hIconSm = wndClass.hIcon;
>
> if(RegisterClassEx(&wndClass)==0)//register class...
> return 0; //quit if it doesn't work
>
> //now create window
> hWnd = CreateWindow(szAppName, szAppName, WS_OVERLAPPEDWINDOW,
> CW_USEDEFAULT, CW_USEDEFAULT,
> CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance,
> NULL);
>
> if(hWnd == NULL)
> return 0;
>
> ShowWindow(hWnd, nCmdShow);
> UpdateWindow( hWnd );
>
> while( GetMessage(&msg, NULL, 0,0))
> {
> TranslateMessage(&msg);
> DispatchMessage(&msg);
> }
> return msg.wParam;
> }
>
>
> //process functions
> LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsgId, WPARAM wParam, LPARAM
> lParam)
> {
> static char *pszHello = "Hello, world";
>
> switch(uMsgId)
> {
> case WM_PAINT:
> {
> HDC hDC;
> PAINTSTRUCT paintStruct;
>
> hDC = BeginPaint( hWnd, &paintStruct);
>
> TextOut(hDC, 0,0, pszHello, lstrlen(pszHello));
>
> EndPaint( hWnd, &paintStruct );
> }
> break;
>
> case WM_DESTROY:
> PostQuitMessage(0);
>
> break;
>
> default:
> return DefWindowProc(hWnd,uMsgId,wParam,lParam);
> }
> return 0;
> }
>
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/photos&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
> Free Linux Tutorials. Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> 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: Noorez K. <coo...@ho...> - 2003-12-24 21:27:03
|
This WinApp closes too fast to see results
#include <windows.h>
LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsgId, WPARAM wParam, LPARAM
lParam);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
pszCmdLine, int nCmdShow)
{
static char szAppName[] = "hello";
HWND hWnd;
MSG msg;
WNDCLASSEX wndClass;
//register class
wndClass.style = 0;
wndClass.lpfnWndProc = WindowProc;
wndClass. cbClsExtra = 0;
wndClass.hInstance = hInstance;
wndClass.hIcon = LoadIcon( hInstance, szAppName);
wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndClass.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
wndClass.lpszMenuName = NULL;
wndClass.lpszClassName = szAppName;
wndClass.hIconSm = wndClass.hIcon;
if(RegisterClassEx(&wndClass)==0)//register class...
return 0; //quit if it doesn't work
//now create window
hWnd = CreateWindow(szAppName, szAppName, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance,
NULL);
if(hWnd == NULL)
return 0;
ShowWindow(hWnd, nCmdShow);
UpdateWindow( hWnd );
while( GetMessage(&msg, NULL, 0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
//process functions
LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsgId, WPARAM wParam, LPARAM
lParam)
{
static char *pszHello = "Hello, world";
switch(uMsgId)
{
case WM_PAINT:
{
HDC hDC;
PAINTSTRUCT paintStruct;
hDC = BeginPaint( hWnd, &paintStruct);
TextOut(hDC, 0,0, pszHello, lstrlen(pszHello));
EndPaint( hWnd, &paintStruct );
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd,uMsgId,wParam,lParam);
}
return 0;
}
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/photos&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
|
|
From: Noorez K. <coo...@ho...> - 2003-12-24 21:14:18
|
My system pause function in this program is not read at the end of the
program so i can't
see the results.
// This program copies the contents of one file
// to another file.
// Program file: copyfile.cpp
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
int main()
{
ifstream in_file;
char ch;
in_file.open("myfile.txt");
in_file.get(ch);
while (! in_file.eof() && ! in_file.fail())
{
cout << ch;
in_file.get(ch);
}
in_file.close();
system("pause");
}
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=dept/features&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca
|