dev-cpp-users Mailing List for Dev-C++ (Page 431)
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: Adam M. <up...@in...> - 2003-02-27 15:48:21
|
>>It is a system extension (variable sized arrays). So whay does VC++ not compile it? Is it too old? -------Original Message------- From: Adam Malinowski Date: ĐÝěđôç, 27 ÖĺâńďőÜńéďň 2003 5:01:10 ěě To: dev...@li... Subject: [Dev-C++] Mistake ? Hi all. One day i made a little mistake. Instead of "char* Name = new char[FilenameLength];" i wrote " char Name[FilenameLength];", where FilenameLength is evaluated by runing program. I didn't notice that and everythig worked properly. Yesterday i compiled the project under VisualC++ 6.0 and ofcourse compiler said it is an error. Ofcourse it is error because compiler needs constant value for table size. Can someone tell me why mingw didn't report any error and what is more interesting: why my program worked properly? regards. Adam. ------------------------------------------------------- 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://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users ---------------------------------------------------------------------- Portal INTERIA.PL zaprasza... >>> http://link.interia.pl/f16c9 |
|
From: Jack C. <jac...@ya...> - 2003-02-27 15:25:33
|
Hi, I noticed that when building a GTK application, the first line in the source file is #include "GTK/gtk.h" . However, the real path is C:\....\Dev-C++5\include\gtk-2.0\gtk\gtk.h. Apparently, the default GTK include folder is C:\....\Dev-C++5\include gtk-2.0\. So, I'd like to know how Dev 5 does that, or how I can manually do it, along with other default paths for lib and other stuff that are in the package. I know I can just install the package and forget about the rest of the stuff, but the reason I'm asking this question is because I want to install GtkGlext, a library that allows people to render OpenGL graphics in GTK. And since neither Dev-C++ nore GtkGlext has a package/documentation for inatallation, I'd like to know how to set it up by myself. I've sent an e-mail to the author of GtkGlext and in his reply I will need to use cgywin and open a .sh file, but the thing is I've never used cgywin before, so I have absolutely no clue. And he said to SET PATH in the DOS Prompt (I guess it's in the c:\autoexec.bat), but I never noticed Dev-C++ did that for any packages. Anyhow, my simple question is, how can I setup GtkGlext in Dev-C++? I will appreciate any replies from anyone who had experience with it, or if someone can help me set up the default folder, as I mentioned above, then I can do the rest myself. Really thanks. If I'm successful, I'll make a package for it, that is, if someone also teaches me how make a package, though I'm willing to learn. Jack ______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca |
|
From: Ioannis V. <no...@ho...> - 2003-02-27 15:09:31
|
It is a system extension (variable sized arrays). =0D =0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys =0D =0D =0D -------Original Message-------=0D =0D From: Adam Malinowski=0D Date: =D0=DD=EC=F0=F4=E7, 27 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 5:01:= 10 =EC=EC=0D To: dev...@li...=0D Subject: [Dev-C++] Mistake ?=0D =0D Hi all.=0D =0D One day i made a little mistake. Instead of "char* Name =3D new char[FilenameLength];"=0D i wrote " char Name[FilenameLength];", where FilenameLength is evaluated= by runing=0D program. I didn't notice that and everythig worked properly. Yesterday i compiled the project=0D under VisualC++ 6.0 and ofcourse compiler said it is an error. Ofcourse i= t is error because=0D compiler needs constant value for table size. Can someone tell me why min= gw didn't report=0D any error and what is more interesting: why my program worked properly?=0D =0D regards.=0D Adam.=0D =20 |
|
From: Adam M. <up...@in...> - 2003-02-27 14:57:54
|
Hi all. One day i made a little mistake. Instead of "char* Name =3D new = char[FilenameLength];" i wrote " char Name[FilenameLength];", where FilenameLength is = evaluated by runing program. I didn't notice that and everythig worked properly. Yesterday i = compiled the project under VisualC++ 6.0 and ofcourse compiler said it is an error. Ofcourse = it is error because compiler needs constant value for table size. Can someone tell me why = mingw didn't report any error and what is more interesting: why my program worked properly? regards. Adam. |
|
From: Ioannis V. <no...@ho...> - 2003-02-27 14:02:37
|
Duh. Sorry but the previous was not corrected completely (it must be my
lunch). =0D
=0D
=0D
-------Original Message-------=0D
=0D
From: Ioannis Vranos=0D
Date: =D0=DD=EC=F0=F4=E7, 27 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 3:59:=
15 =EC=EC=0D
To: Dev-C++ Mailing List=0D
Subject: Re: [Dev-C++] Struct "tags" and things=0D
=0D
A correction:=0D
=0D
=0D
=0D
-------Original Message-------=0D
=0D
From: Ioannis Vranos=0D
Date: =D0=DD=EC=F0=F4=E7, 27 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 3:56:=
22 =EC=EC=0D
To: dev...@li...=0D
Subject: Re: [Dev-C++] Struct "tags" and things=0D
=0D
-------Original Message-------=0D
=0D
From: Daniel Glenfield=0D
Date: =D0=DD=EC=F0=F4=E7, 27 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 2:08:=
53 =EC=EC=0D
To: dev...@li...=0D
Subject: [Dev-C++] Struct "tags" and things=0D
=0D
=0D
typedef struct _MyStruct=0D
{=0D
//...Data=0D
=0D
} MyStruct, FAR * LPMYSTRUCT=0D
=0D
=0D
My questions are=0D
1) Why is it _MyStruct at the top? Is that the structure's real name and =
=0D
MyStruct is the typedef'd name?=0D
=0D
=0D
=3D=3D> _MyStruct is the name of the type and MyStruct is a synonym. It i=
s
equivalent of:=0D
=0D
struct _MyStruct=0D
{=0D
// ...=0D
};=0D
=0D
typedef _MyStruct MyStruct;=0D
typedef _MyStruct FAR * LPMYSTRUCT;=0D
=0D
=0D
=0D
=0D
=0D
2) I know about FAR pointers, but why is a pointer needed here? Why don't=
I =0D
just put MyStruct* LPMYSTRUCT; in my code?=0D
=0D
=0D
=3D=3D> FAR is a system dependent keyword. The above is equivalent to:=0D
=0D
typedef _MyStruct FAR *LPMYSTRUCT;=0D
=0D
=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20 |
|
From: Ioannis V. <no...@ho...> - 2003-02-27 13:59:27
|
A correction:=0D
=0D
=0D
=0D
-------Original Message-------=0D
=0D
From: Ioannis Vranos=0D
Date: =D0=DD=EC=F0=F4=E7, 27 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 3:56:=
22 =EC=EC=0D
To: dev...@li...=0D
Subject: Re: [Dev-C++] Struct "tags" and things=0D
=0D
-------Original Message-------=0D
=0D
From: Daniel Glenfield=0D
Date: =D0=DD=EC=F0=F4=E7, 27 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 2:08:=
53 =EC=EC=0D
To: dev...@li...=0D
Subject: [Dev-C++] Struct "tags" and things=0D
=0D
=0D
typedef struct _MyStruct=0D
{=0D
//...Data=0D
=0D
} MyStruct, FAR * LPMYSTRUCT=0D
=0D
=0D
My questions are=0D
1) Why is it _MyStruct at the top? Is that the structure's real name and =
=0D
MyStruct is the typedef'd name?=0D
=0D
=0D
=3D=3D> _MyStruct is the name of the type and MyStruct is a synonym. It i=
s
equivalent of:=0D
=0D
struct _MyStruct=0D
{=0D
// ...=0D
}FAR * LPMYSTRUCT;=0D
=0D
typedef _MyStruct MyStruct;=0D
=0D
=0D
=0D
=0D
=0D
2) I know about FAR pointers, but why is a pointer needed here? Why don't=
I =0D
just put MyStruct* LPMYSTRUCT; in my code?=0D
=0D
=0D
=3D=3D> FAR is a system dependent keyword. The above is equivalent to:=0D
=0D
Corrected: typedef _MyStruct FAR *LPMYSTRUCT;=0D
=0D
=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20 |
|
From: Ioannis V. <no...@ho...> - 2003-02-27 13:56:39
|
-------Original Message-------=0D
=0D
From: Daniel Glenfield=0D
Date: =D0=DD=EC=F0=F4=E7, 27 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 2:08:=
53 =EC=EC=0D
To: dev...@li...=0D
Subject: [Dev-C++] Struct "tags" and things=0D
=0D
=0D
typedef struct _MyStruct=0D
{=0D
//...Data=0D
=0D
} MyStruct, FAR * LPMYSTRUCT=0D
=0D
=0D
My questions are=0D
1) Why is it _MyStruct at the top? Is that the structure's real name and =
=0D
MyStruct is the typedef'd name?=0D
=0D
=0D
=3D=3D> _MyStruct is the name of the type and MyStruct is a synonym. It i=
s
equivalent of:=0D
=0D
struct _MyStruct=0D
{=0D
// ...=0D
}FAR * LPMYSTRUCT;=0D
=0D
typedef _MyStruct MyStruct;=0D
=0D
=0D
=0D
=0D
=0D
2) I know about FAR pointers, but why is a pointer needed here? Why don't=
I =0D
just put MyStruct* LPMYSTRUCT; in my code?=0D
=0D
=0D
=3D=3D> FAR is a system dependent keyword. The above is equivalent to:=0D
=0D
MyStruct FAR *LPMYSTRUCT;=0D
=0D
=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20 |
|
From: Per W. <pw...@ia...> - 2003-02-27 12:18:45
|
The first name directly after struct is an old and strange C thingie,
where the structs lives in their own name-space.
You don't need to declare a pointer type for each data type you create.
It's just that for some environments, the FAR #declare are really needed
and contains __far, far, _far or any number of compiler-specific keyword.
By having declared a pointer type containing that extra FAR thingie, you
don't have to remember to use it everywhere in your program whenever you
need a pointer.
For the majority of the code you write, just do what you like.
/Per W
On Thu, 27 Feb 2003, Daniel Glenfield wrote:
>
>
> typedef struct _MyStruct
> {
> //...Data
>
> } MyStruct, FAR * LPMYSTRUCT
>
>
> My questions are
> 1) Why is it _MyStruct at the top? Is that the structure's real name and
> MyStruct is the typedef'd name?
>
> 2) I know about FAR pointers, but why is a pointer needed here? Why don't I
> just put MyStruct* LPMYSTRUCT; in my code?
>
>
> Following from this, I see
> #define GetMyStructProperties(lpdm) ((LPMYSTRUCT)(lpdm))
>
>
> and the function is called often. What is going on?
>
>
> _________________________________________________________________
> Stay in touch with MSN Messenger http://messenger.msn.co.uk
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Daniel G. <sp...@ho...> - 2003-02-27 12:06:18
|
typedef struct _MyStruct
{
//...Data
} MyStruct, FAR * LPMYSTRUCT
My questions are
1) Why is it _MyStruct at the top? Is that the structure's real name and
MyStruct is the typedef'd name?
2) I know about FAR pointers, but why is a pointer needed here? Why don't I
just put MyStruct* LPMYSTRUCT; in my code?
Following from this, I see
#define GetMyStructProperties(lpdm) ((LPMYSTRUCT)(lpdm))
and the function is called often. What is going on?
_________________________________________________________________
Stay in touch with MSN Messenger http://messenger.msn.co.uk
|
|
From: Ioannis V. <no...@ho...> - 2003-02-27 11:00:22
|
-------Original Message-------=0D
=0D
From: gi...@li...=0D
Date: =D0=DD=EC=F0=F4=E7, 27 =D6=E5=E2=F1=EF=F5=DC=F1=E9=EF=F2 2003 7:13:=
25 =F0=EC=0D
To: Dev-C++ Mailing List=0D
Subject: Re: [Dev-C++] need some explanation=0D
=0D
On Tue, Feb 25, 2003 at 05:10:26PM +0200, Ioannis Vranos wrote:=0D
> Actually that information is wrong. stdlib.h and cstdlib are part of th=
e
C++=0D
> standard (the C subset of C++ but it doesn't matter). And do not confus=
e
C++=0D
> with C, they are different languages. Example:=0D
> =0D
> C99 code but not valid C++:=0D
> =0D
> #include <stddef.h>=0D
> #include <stdio.h>=0D
> =0D
> =0D
> int main()=0D
> {=0D
> size_t s=3D7;=0D
> =0D
> printf("%sz\n", s);=0D
> =0D
> }=0D
> =0D
> =0D
> Even between C90 vs C++98 there are differences. For example:=0D
> =0D
> int main()=0D
> {=0D
> char s[10]=3D"0123456789";=0D
> =0D
> return 0; =0D
> }=0D
> =0D
> is valid C90 but not C++.=0D
> =0D
> =0D
=0D
Hello Ioannis,=0D
=0D
I do not know C99, but I seem to get that the "strange" part=0D
of the C99 code you wrote is the format used: "s" is a (sort of) =0D
integer and one can't print it as a string. =0D
=0D
=0D
=3D=3D> In C99, size_t is still a typedef, but it can be a typedef of som=
e=20
exotic" type, that is not of those standard built in types that are provi=
ded
In C99 the built in types long long and _Bool (yes _Bool), as integral
types have been added and size_t can be larger than long long, and a spec=
ial
format specifier has been added, %sz. =0D
=0D
=3D=3D> In the contrary, in both C90 and C++98, size_t is a typedef of on=
e of
the provided built in types (usually unsigned long). So in C90 if you wan=
ted
to printf() a size_t you would do:=0D
=0D
size_t something=3D0;=0D
=0D
=2E..=0D
=0D
printf(%lu\n", (unsigned long)something));=0D
=0D
=3D=3D> I would agree with the %sz specifier so as to not need casting an=
d work
with whatever typedef size_t is, but all the rest are really crap (as you
can understand i strongly do not like C99).=0D
=0D
=0D
=0D
I'm more concerned about the second piece of code, as I happen to =0D
use C89 and C++98). It looks OK to me for both the languages, could =0D
you shed some light on why it is not C++98?=0D
=0D
=0D
=3D=3D> Because the initialization string contains an additional characte=
r, '\0'
and C++98 protects you in case you made a mistake.=0D
=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20 |
|
From: Samuel K. <ib...@ly...> - 2003-02-27 06:30:42
|
It is because the char array is to long for C++ (I don't know C90 so I'll just tell you what I know about the C++). C++ ends a string with array with the '\0' character. It is its way of terminating a string. When an array is created, if '\0' is not already at the end of the char string, the compiler will automatically append '\0' to the end of the array. The trouble in the example though is that you have 10 chars, and the compiler is trying to add another char. This is going to cause your array to overflow and generate a compiler error. (Note: Compiler errors will only be made when you are initializing your string in this manner. If you had
char s[] = "0123456789";
it would compile perfectly okay, except your array would be 11 chars long.)
--
On Wed, 26 Feb 2003 18:14:34
Luigi Santillo wrote:
>On Tue, Feb 25, 2003 at 05:10:26PM +0200, Ioannis Vranos wrote:
>> Actually that information is wrong. stdlib.h and cstdlib are part of the C++
>> standard (the C subset of C++ but it doesn't matter). And do not confuse C++
>> with C, they are different languages. Example:
>>
>> C99 code but not valid C++:
>>
>> #include <stddef.h>
>> #include <stdio.h>
>>
>>
>> int main()
>> {
>> size_t s=7;
>>
>> printf("%sz\n", s);
>>
>> }
>>
>>
>> Even between C90 vs C++98 there are differences. For example:
>>
>> int main()
>> {
>> char s[10]="0123456789";
>>
>> return 0;
>> }
>>
>> is valid C90 but not C++.
>>
>>
>
>Hello Ioannis,
>
>I do not know C99, but I seem to get that the "strange" part
>of the C99 code you wrote is the format used: "s" is a (sort of)
>integer and one can't print it as a string.
>
>I'm more concerned about the second piece of code, as I happen to
>use C89 and C++98). It looks OK to me for both the languages, could
>you shed some light on why it is not C++98?
>
>TIA
>--
>>> gisan >>
>If you stand on your head, you will get footprints in your hair.
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Scholarships for Techies!
>Can't afford IT training? All 2003 ictp students receive scholarships.
>Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
>www.ictp.com/training/sourceforge.asp
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
_____________________________________________________________
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus
|
|
From: Luigi S. <gi...@li...> - 2003-02-27 05:11:28
|
On Tue, Feb 25, 2003 at 05:10:26PM +0200, Ioannis Vranos wrote:
> Actually that information is wrong. stdlib.h and cstdlib are part of the C++
> standard (the C subset of C++ but it doesn't matter). And do not confuse C++
> with C, they are different languages. Example:
>
> C99 code but not valid C++:
>
> #include <stddef.h>
> #include <stdio.h>
>
>
> int main()
> {
> size_t s=7;
>
> printf("%sz\n", s);
>
> }
>
>
> Even between C90 vs C++98 there are differences. For example:
>
> int main()
> {
> char s[10]="0123456789";
>
> return 0;
> }
>
> is valid C90 but not C++.
>
>
Hello Ioannis,
I do not know C99, but I seem to get that the "strange" part
of the C99 code you wrote is the format used: "s" is a (sort of)
integer and one can't print it as a string.
I'm more concerned about the second piece of code, as I happen to
use C89 and C++98). It looks OK to me for both the languages, could
you shed some light on why it is not C++98?
TIA
--
>> gisan >>
If you stand on your head, you will get footprints in your hair.
|
|
From: nada <na...@ca...> - 2003-02-27 00:21:03
|
>cout << setprecision(2) << setiosflags(ios::fixed) ;
I read something recently that said this would be the more correct:
cout << setprecision(2) << setiosflags(ios::fixed | ios::showpoint);
The reference mentioned that showpoint should always be set when using
setiosflag.
Can anyone shed more light on this?
{rb}
--
Believe those who are seeking truth, doubt those who find it. - Andre' Gide
|
|
From: Ioannis V. <no...@ho...> - 2003-02-26 23:31:55
|
The MINGW team have setup a nice page listing the package updates:=0D =0D http://www.mingw.org/download.shtml=0D =0D =0D Everyone can download and have the latest updates. I do not know whether Colin has placed these updates at the latest Dev-C++ distribution.=0D =0D =0D Ioannis Vranos=0D =0D * Programming pages: http://www.noicys.freeurl.com=0D * Alternative URL: http://run.to/noicys=20 |
|
From: <ri...@te...> - 2003-02-26 23:24:37
|
jrw...@ne... escribió:
>#include <iomanip> //required for setprecision
>#include <iostream.h> // required for fixed or scientific manipulators
>
>void main ()
>{
> cout<<setprecision(2)<<fixed; //compiler error - 'fixed' udeclared???
>
>
nada´s reply is correct but you can also use:
cout << setprecision(2) << setiosflags(ios::fixed) ;
--
Cheers
Ricardo Amores Hernández
ricky QuitaEsto @ telecable.es
|
|
From: <ake...@br...> - 2003-02-26 22:21:21
|
I will be out of the office starting 02/26/2003 and will not return until 03/04/2003. If you need immediate assistance please contact Leland Williams (lwi...@br...) or Shon Scarver (ssc...@br...). Thank You, Amos Kermisch |
|
From: nada <na...@ca...> - 2003-02-26 21:29:55
|
> cout<<setprecision(2)<<fixed; //compiler error - 'fixed' udeclared???
Use:
cout.setf(ios::fixed);
cout.precision(2);
{rb}
--
This time, like all time, is a very good one if we but know what to do with
it. - Ralph Waldo Emerson
|
|
From: Per W. <pw...@ia...> - 2003-02-26 21:02:10
|
You should call the inherrited constructor too, i.e.
Point_2D::Point_2D() : Point_1D(),_y =3D 0 {}
Point_2D::Point_2D(const float x,const float y) : Point_1D(x),_y =3D y {}
Point_2D::Point_2D(const Point_2D &p) : Point_1D(p),_y =3D p.y() {}
Point_2D::Point_2D(const Point_1D &p,const float y) : Point_1D(p),_y =3D y
{}
Also - no new in your operators. Who would release your memory? The
receiver doesn't expect a pointer, but a reference, so the receiver won't
release it. Declare a local variable
{ Point_2D res; xxxxx; return res; }
Also, you normally uses friend operators when overriding binary operators.
Here's a sample Vec3 class - sorry strange indent but the cut-paste went
bananas :-)
struct Vec3 {
double x,y,z;
friend Vec3& operator+=3D(Vec3 &p,const Vec3 &s)
{ p.x +=3D s.x; p.y +=3D s.y; p.z +=3D s.z; return p; }
friend Vec3& operator-=3D(Vec3 &p,const Vec3 &s)
{ p.x -=3D s.x; p.y -=3D s.y; p.z -=3D s.z; return p; }
friend Vec3& operator*=3D(Vec3 &p,const Vec3 &s)
{ p.x *=3D s.x; p.y *=3D s.y; p.z *=3D s.z; return p; }
friend Vec3& operator*=3D(Vec3 &p,real s)
{ p.x *=3D s; p.y *=3D s; p.z *=3D s; return p; }
friend Vec3& operator/=3D(Vec3 &p,real s)
{ p.x /=3D s; p.y /=3D s; p.z /=3D s; return p; }
friend const Vec3 operator+(const Vec3 &a,const Vec3 &b)
{ Vec3 res; res.x =3D a.x+b.x; res.y =3D a.y+b.y; res.z =3D a.z+b.z; re=
turn res; }
friend const Vec3 operator-(const Vec3 &a,const Vec3 &b)
{ Vec3 res; res.x =3D a.x-b.x; res.y =3D a.y-b.y; res.z =3D a.z-b.z; re=
turn res; }
friend const Vec3 operator*(const Vec3 &a,const Vec3 &b)
{ Vec3 res; res.x =3D a.x*b.x; res.y =3D a.y*b.y; res.z =3D a.z*b.z; re=
turn res; }
friend const Vec3 operator*(real s,const Vec3& a)
{ Vec3 res; res.x =3D a.x*s; res.y =3D a.y*s; res.z =3D a.z*s; return r=
es; }
friend const Vec3 operator*(const Vec3 &a,real s)
{ Vec3 res; res.x =3D a.x*s; res.y =3D a.y*s; res.z =3D a.z*s; return r=
es; }
friend const Vec3 operator/(const Vec3 &a,real s)
{ Vec3 res; res.x =3D a.x/s; res.y =3D a.y/s; res.z =3D a.z/s; return r=
es; }
friend const Vec3 operator/(const Vec3 &a,const Vec3& b)
{ Vec3 res; res.x =3D a.x/b.x; res.y =3D a.y/b.y; res.z =3D a.z/b.z; re=
turn res; }
friend const Vec3 operator-(const Vec3 &a)
{ Vec3 res; res.x =3D -a.x; res.y =3D -a.y; res.z =3D -a.z; return res;=
}
friend const Vec3 abs(const Vec3& a)
{ Vec3 res; res.x =3D a.x >=3D 0 ? a.x : -a.x; res.y =3D a.y >=3D 0 ? a=
=2Ey : -a.y;
res.z 0 ? a.z : -a.z; return res; }
bool operator=3D=3D(const Vec3& a)
{ return IS_SMALL(a.x-x) && IS_SMALL(a.y-y) && IS_SMALL(a.z-z); }
bool operator!=3D(const Vec3& a)
{ return !IS_SMALL(a.x-x) || !IS_SMALL(a.y-y) || !IS_SMALL(a.z-z); }
/Per W
On Wed, 26 Feb 2003, Micka=EBl Wolff wrote:
> Hello,
>
> I restart my C++ learning. For do this, I write some C++ classes. I
> made a first class 'Point'. I shall be use in the future, in other
> relative classes (triangle class, circle class, etc ...).
>
> The first derivate class are Point_1D, it runs good. The second
> inheritance from Point_1D to Point_2D do a lot of problemes with
> constructors. I wrote its into my sources (in the attachement). Can you
> say me what is wrong ?
>
> Thanks for your help !
>
> PS.: I hope they are not off topics ! :o)
>
|
|
From: <jrw...@ne...> - 2003-02-26 20:34:55
|
#include <iomanip> //required for setprecision
#include <iostream.h> // required for fixed or scientific manipulators
void main ()
{
cout<<setprecision(2)<<fixed; //compiler error - 'fixed' udeclared???
__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
|
|
From: <mic...@la...> - 2003-02-26 19:48:41
|
Hello, I restart my C++ learning. For do this, I write some C++ classes. I made a first class 'Point'. I shall be use in the future, in other relative classes (triangle class, circle class, etc ...). The first derivate class are Point_1D, it runs good. The second inheritance from Point_1D to Point_2D do a lot of problemes with constructors. I wrote its into my sources (in the attachement). Can you say me what is wrong ? Thanks for your help ! PS.: I hope they are not off topics ! :o) |
|
From: <jm...@te...> - 2003-02-26 19:33:22
|
I can't compile long lines with dev-cpp 4.9.7.6 anyone know how compile long lines. g++.exe ../src/AboutDialog.o ../src/AColor.o ../src/AStatus.o ../src/AudacityApp.o ../src/AudioIO.o ../src/Benchmark.o ../src/BlockFile.o etc etc etc...... include" -I"../lib-src/libvorbis/include" -I"../lib-src/libnyquist/nyx" - I"../lib-src/portmixer/px_common" -I"../lib-src/libsamplerate/src" --pipe - D_X86_=1 -DWIN32 -D_WIN32 -DWINVER=0x0400 -D__WIN95__ - D__GNUWIN32__ -D__WIN 32__ -mthreads -DSTRICT -D__WXMSW__ -D__WINDOWS__ -Wall -fno-pcc-struct-ret urn -O2 -fno-rtti -fno-exceptions Too much long line. make.exe: *** [audacityJOAN.exe] Error 255 |
|
From: Samuel K. <ib...@ly...> - 2003-02-26 18:22:31
|
Do not use * until you're teacher shows it to you in class (if you are still taking a class). Just use a &. If you want to learn how to use the * either learn it in class or in a book (any first semester c++ course should teach * before it is over). Do a lot of reading or studing before you use it because a lot of people have trouble with the *. The * is a third way to pass parameters. There are a total of three ways to pass parameters. void f(int anint) : call by value void f(int &anint) : call by reference void f(int *anint) : call by address If you do not have a book on you and you aren't taking a class go to a site like cprogramming.com that has tutorials on things like *, &, and call by value. _____________________________________________________________ Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year. http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus |
|
From: <mr...@c2...> - 2003-02-26 14:39:43
|
Hi all, I am trying to customize the common file open dialog box by specifying a custom template in which I add additional controls. The file open dialog box gets resized (to accomodate the extra contols) as it should, but the custom template pops up as a separate window that you cannot move. This window gets closed when you close the file open dialog. Everything would have been fine if only this window had been overlaid (underlaid..?:-)) on the file open dialog. I imported a working VisualC++ example and got it to compile, but got the same problem as with my own code, which leads me to believe that this is either a MingW or a Dev-C problem. Anyone seen this, or have a working example in Dev-C? (Preferrably C, not C++). This is extremely annoying, and I would appreciate your input on the problem. -=D8yvind --------------------------------- mr...@c2... @ work |
|
From: Asko K. <ask...@sc...> - 2003-02-26 13:49:53
|
My problems with C/C++ differences still continue: - I have two almost identical libraries that I want to compile (with DevCpp 4.9.7.0). Lua40 (scripting language engine) compiles okay (objdump shows proper ANSI C function names), but (a newer version) Lua50 creates C++ mangled function names in the .o files. How can I prevent this and what might be causing it? I've tried "-xc" as compiler option (to force C language) - didn't work. I've lower-cap'd all the filenames so that they're not mistaken to be .C . The source itself should be plain ANSI C only, not C++. Can it be some old temporary file lurking somewhere, from the time my files were .C ...? Any other ideas? -ak |
|
From: Matthews <dem...@uw...> - 2003-02-26 13:46:34
|
#include <conio.h> and add -lconio to your linker options. At 10:58 AM 25/02/2003 -0600, Samuel Keding wrote: >I am having trouble figuring out how to get this to link to my project. I checked the FAQ which had something about clrscr, but it must have been written for dev 4.0 because I'm not finding the options in dev that the FAQ told me to change. How do I link to conio.o so I can use clrscr()? > > >_____________________________________________________________ >Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year. >http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus > > >------------------------------------------------------- >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://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |