dev-cpp-users Mailing List for Dev-C++ (Page 617)
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: Ioannis V. <no...@ya...> - 2002-03-03 02:25:16
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of h.r...@gm... > Sent: Sunday, March 03, 2002 3:58 AM > To: Dev...@li... > Subject: RE: [Dev-C++] template and prototype > > > all of that I have done ( some days ago ) > It is namely a warning, but no exe is created. Indeed! I just checked BC++ and they have not implemented export too (the compiler ignores it). I knew its existence from theory (TC++PL Special Edition). Till it gets implemented you can do one of the following: a) Provide the definition at every compilation unit, possibly in a header file. b) Do not use templates but overloaded functions. This implies one definition for anything making it a mess to maintain. Also in overloading there may take place implicit type conversions without any warning and that may be bad. Do not follow option b. :) Follow option a and be patient till it gets implemented. The official C++ standard is very recent, and the extent in which it has been implemented is magnificent for such a small period and such a big size. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys |
|
From: <h.r...@gm...> - 2002-03-03 01:57:38
|
> > -----Original Message----- > > Subject: [Dev-C++] template and prototype > > > > Hi Ioannis, > > many thanks for the quick answer. > > I followed your tip but the linker means: > > > > 3 hr_math.cpp > > warning: keyword 'export' not implemented and will be ignored > > > > Horst > > > > PS: sorry Ioannis for the PM > > > > > If this is only a warning and the exe is created and it works, ignore > it. Its meaning is obvious. However for best results You had better > download the latest MINGW32 release and replace the one that comes with > Dev-C++. It is high time a new interim release of Dev-C++ to be released > having the most recent version of MINGGW32. Colin are you there? :) > > Download the latest MINGW32 by clicking here: > http://prdownloads.sourceforge.net/mingw/MinGW-1.1.tar.gz (release > 2001-09-20 05:00) . > > > However you must be able to untar/gunzip the contents. One program that > does this in Windows is Winrar. > > > This link is from page: > http://sourceforge.net/project/showfiles.php?group_id=2435 > > Official MINGW site: http://www.mingw.org > > > > Ioannis all of that I have done ( some days ago ) It is namely a warning, but no exe is created. Horst -- -------------------------- Horst Rößner Postf. 1802 52205 Stolberg 02402 / 6178 0171 6455636 GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net |
|
From: Ioannis V. <no...@ya...> - 2002-03-03 01:44:04
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of h.r...@gm... > Sent: Sunday, March 03, 2002 3:24 AM > To: dev...@li... > Subject: [Dev-C++] template and prototype > > Hi Ioannis, > many thanks for the quick answer. > I followed your tip but the linker means: > > 3 hr_math.cpp > warning: keyword 'export' not implemented and will be ignored > > Horst > > PS: sorry Ioannis for the PM > If this is only a warning and the exe is created and it works, ignore it. Its meaning is obvious. However for best results You had better download the latest MINGW32 release and replace the one that comes with Dev-C++. It is high time a new interim release of Dev-C++ to be released having the most recent version of MINGGW32. Colin are you there? :) Download the latest MINGW32 by clicking here: http://prdownloads.sourceforge.net/mingw/MinGW-1.1.tar.gz (release 2001-09-20 05:00) . However you must be able to untar/gunzip the contents. One program that does this in Windows is Winrar. This link is from page: http://sourceforge.net/project/showfiles.php?group_id=2435 Official MINGW site: http://www.mingw.org Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys |
|
From: <h.r...@gm...> - 2002-03-03 01:24:07
|
> > -----Original Message-----
> > Subject: [Dev-C++] template and prototype
> >
> >
> > Hello,
> >
> > Is it forbidden to have a prototype of a template in a header file ?
> > For example:
> >
> > a.h
> > template <class T> T sqr(T x);
> >
> > a.cpp
> > template <class T> T sqr(T x) { return x * x; }
> >
> > this doesnt link.
> > If I put the definition
> > template <class T> T sqr(T x) { return x * x; }
> > in the header, it works.
>
> If you want to place the definition in one file and use declarations to
> the rest, you must place the keyword export in the template definition
> in the style:
>
> export template <class T>
> T sqr(T x) { return x*x; }
>
>
> Then you can use the declaration in the way you used it to access the
> template from other translation units. The export is necessary to make
> it possible someone to make a compiler that knows what is going on. :)
> If you do not like export you must provide the template definition in
> every unit you use it (templates have by default local scope in contrast
> to ordinary functions).
>
> Ioannis
Hi Ioannis,
many thanks for the quick answer.
I followed your tip but the linker means:
3 hr_math.cpp
warning: keyword 'export' not implemented and will be ignored
Horst
PS: sorry Ioannis for the PM
--
--------------------------
Horst Rößner
Postf. 1802
52205 Stolberg
02402 / 6178
0171 6455636
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
|
|
From: Ioannis V. <no...@ya...> - 2002-03-03 01:04:16
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of h.r...@gm...
> Sent: Sunday, March 03, 2002 2:36 AM
> To: dev...@li...
> Subject: [Dev-C++] template and prototype
>
>
> Hello,
>
> Is it forbidden to have a prototype of a template in a header file ?
> For example:
>
> a.h
> template <class T> T sqr(T x);
>
> a.cpp
> template <class T> T sqr(T x) { return x * x; }
>
> this doesnt link.
> If I put the definition
> template <class T> T sqr(T x) { return x * x; }
> in the header, it works.
If you want to place the definition in one file and use declarations to
the rest, you must place the keyword export in the template definition
in the style:
export template <class T>
T sqr(T x) { return x*x; }
Then you can use the declaration in the way you used it to access the
template from other translation units. The export is necessary to make
it possible someone to make a compiler that knows what is going on. :)
If you do not like export you must provide the template definition in
every unit you use it (templates have by default local scope in contrast
to ordinary functions).
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
|
|
From: <h.r...@gm...> - 2002-03-03 00:36:35
|
Hello,
Is it forbidden to have a prototype of a template in a header file ?
For example:
a.h
template <class T> T sqr(T x);
a.cpp
template <class T> T sqr(T x) { return x * x; }
this doesnt link.
If I put the definition
template <class T> T sqr(T x) { return x * x; }
in the header, it works.
Thanks in advance
Horst
--
--------------------------
Horst Rößner
Postf. 1802
52205 Stolberg
02402 / 6178
0171 6455636
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
|
|
From: <50...@ce...> - 2002-03-02 12:21:34
|
Hi!
What is wrong with this code?
---------
hButton =3D CreateWindowEx(0, "EDIT", NULL, WS_CHILD |=20
WS_VISIBLE |
WS_TABSTOP,
50, 50, 120, 20, hWnd, (HMENU)111,=20
hMainInst,
NULL);
SendMessage(hButton, WM_SETTEXT, 0,
(LPARAM)"Ahoj"); /// any interactin=20
(like this
one)
/// couses the app=20
crash
--------
I need to create a text box within the main window.
Thanks in advance!
~tom~
=3D=3D=3D=3D ocen=ECn=ED =3D=3D=3D=3D=3D=3D
Centrum.cz nejlep=B9=EDm port=E1lem roku 2001 v=EDce na:=20
http://tipy.centrum.cz/page.phtml?code=3DZavinac=20
|
|
From: <fc...@ya...> - 2002-03-02 05:31:33
|
Sir,
I copied TC from CD to Hard Disk.When I run
a Turbo C program the compiler indicates that it
has no 'TV.LIB' files. Why this happens? Where can
I get the tv.lib file? Please answer me.
Thanking you,
Yours sincerly
Shashang
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
|
|
From: <jsc...@gm...> - 2002-03-01 14:09:24
|
Hi anybody uses the special package of wxwindows for DEVCPP ? juergen |
|
From: carlos D. M. <cg...@wo...> - 2002-03-01 12:32:50
|
Ops! In the last message I forgot say that with the version
system("\"disk:/fullpath/file.ext\"");
you can use files with spaces, so is better to use it.
Sorry for add a new message when could say into the last.
|
|
From: Ioannis V. <no...@ya...> - 2002-02-28 15:28:09
|
-----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Benjamin Wheeless Sent: Thursday, February 28, 2002 4:06 PM To: dev...@li... Subject: RE: [Dev-C++] Time stamping an output file. Ioannis, You didn't let me down man. Searching every crevace for an inefficiency. I like your style. I wasn't aware that strftime() was portable to UNIX, but after looking up the function I see that it is fully ANSI C compatible...so thank you for pointing out my misleading statement about the portability. Secondly, this is just a "test" program...I specify the path in the actual production program because the program does not run in the directory where the output file is placed as is common with production environment directory structures. You are right though, if you want the output file to go into the directory from where the *.exe is run from, then you do not need to provide a path. The file is created in the path you *are* the time the program is executed. E.g. if you are in MSDOS/Windows, your exe is placed as C:\c\temp.exe , you have C:\c in the path variable and you run it from any other directory e.g. C:\program files\microsoft\world\domination, the .txt will be created in C:\program files\microsoft\world\domination . If you want the output file to go always into the directory from where the .exe is run from, only then you *do* need to provide a path. Thanks for the analysis. Have a good day. Benjamin Wheeless Network Systems - Delta Airlines, Inc. Atlanta, GA - USA 30320 ============================== Thanks for the compliments. Ioannis * Ioannis Vranos * Programming pages: <http://www.noicys.d2g.com/> http://www.noicys.d2g.com * Alternative URL: <http://run.to/noicys> http://run.to/noicys |
|
From: Benjamin W. <ben...@ho...> - 2002-02-28 14:06:27
|
<html><div style='background-color:'><DIV>
<P>Ioannis,</P>
<P>You didn't let me down man. Searching every crevace for an inefficiency. I like your style. I wasn't aware that strftime() was portable to UNIX, but after looking up the function I see that it is fully ANSI C compatible...so thank you for pointing out my misleading statement about the portability.</P>
<P>Secondly, this is just a "test" program...I specify the path in the actual production program because the program does not run in the directory where the output file is placed as is common with production environment directory structures. </P>
<P>You are right though, if you want the output file to go into the directory from where the *.exe is run from, then you do not need to provide a path.</P>
<P>Thanks for the analysis. Have a good day.<BR><BR><FONT face="Geneva, Arial, Sans-serif" size=2>Benjamin Wheeless<BR></FONT><FONT face="Geneva, Arial, Sans-serif" size=2><STRONG>Network Systems - Delta Airlines, Inc.<BR></STRONG></FONT><FONT face=Arial size=2><STRONG>Atlanta, GA - USA 30320<BR></STRONG></FONT><FONT face=Arial size=2><STRONG>==============================</STRONG></FONT></P></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>----Original Message Follows----
<DIV></DIV>From: "Ioannis Vranos" <NO...@YA...>
<DIV></DIV>To: "Dev-C++" <DEV...@LI...>
<DIV></DIV>Subject: RE: [Dev-C++] Time stamping an output file.
<DIV></DIV>Date: Thu, 28 Feb 2002 15:23:02 +0200
<DIV></DIV>
<DIV></DIV>-----Original Message-----
<DIV></DIV>From: dev...@li...
<DIV></DIV>[mailto:dev...@li...] On Behalf Of Benjamin
<DIV></DIV>Wheeless
<DIV></DIV>Sent: Thursday, February 28, 2002 3:05 PM
<DIV></DIV>To: dev...@li...
<DIV></DIV>Subject: RE: [Dev-C++] Time stamping an output file.
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>Morning,
<DIV></DIV>
<DIV></DIV>First of all, thanks again Ioannis and Jason for the suggestions.
<DIV></DIV>
<DIV></DIV>Secondly, I figured if anyone were interested, below is how I solved
<DIV></DIV>this time stamp problem. It is not portable to a Unix/Unix-based
<DIV></DIV>platform, but since the job on my end runs on an NT platform...it serves
<DIV></DIV>the purpose that I need it to serve.
<DIV></DIV>
<DIV></DIV>/*DATE STAMP TEST PROGRAM*/
<DIV></DIV>
<DIV></DIV>#include <STDIO.H>
<DIV></DIV>#include <STDLIB.H>
<DIV></DIV>#include <TIME.H>
<DIV></DIV>
<DIV></DIV>int main()
<DIV></DIV>{
<DIV></DIV>FILE* testfile ;
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>char* PtrToFname ;
<DIV></DIV>
<DIV></DIV>Not needed
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>char FileName[27] ;
<DIV></DIV>time_t CurTime ;
<DIV></DIV>struct tm* datetime ;
<DIV></DIV>
<DIV></DIV>CurTime = time( NULL ) ;
<DIV></DIV>datetime = localtime( &CurTime ) ;
<DIV></DIV>
<DIV></DIV>strftime( FileName, 27, "C:\\temp\\hsloan%Y%m%d.txt", datetime ) ;
<DIV></DIV>
<DIV></DIV>printf( "%s", FileName ) ;
<DIV></DIV>
<DIV></DIV>PtrToFname = FileName ;
<DIV></DIV>
<DIV></DIV>Not needed
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>testfile = fopen( PtrToFname, "w" ) ;
<DIV></DIV>if( testfile == NULL )
<DIV></DIV>{
<DIV></DIV>printf( "\nUNABLE TO CREATE OUTPUT FILE! (ABNORMAL TERMINATION)\n" )
<DIV></DIV>;
<DIV></DIV>exit( 0 ) ;
<DIV></DIV>}
<DIV></DIV>
<DIV></DIV>fclose( testfile ) ;
<DIV></DIV>
<DIV></DIV>return 0 ;
<DIV></DIV>}
<DIV></DIV>
<DIV></DIV>Thanks again everyone.
<DIV></DIV>
<DIV></DIV>Benjamin Wheeless
<DIV></DIV>Network Systems - Delta Airlines, Inc.
<DIV></DIV>Atlanta, GA - USA 30320
<DIV></DIV>==============================
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>So the program becomes:
<DIV></DIV>
<DIV></DIV>/*DATE STAMP TEST PROGRAM*/
<DIV></DIV>
<DIV></DIV>#include <STDIO.H>
<DIV></DIV>#include <STDLIB.H>
<DIV></DIV>#include <TIME.H>
<DIV></DIV>
<DIV></DIV>int main(void)
<DIV></DIV>{
<DIV></DIV>FILE* testfile ;
<DIV></DIV>char FileName[27] ;
<DIV></DIV>time_t CurTime ;
<DIV></DIV>struct tm* datetime ;
<DIV></DIV>
<DIV></DIV>CurTime = time( NULL ) ;
<DIV></DIV>datetime = localtime( &CurTime ) ;
<DIV></DIV>
<DIV></DIV>strftime( FileName, 27, "C:\\temp\\hsloan%Y%m%d.txt", datetime ) ;
<DIV></DIV>
<DIV></DIV>printf( "%s", FileName ) ;
<DIV></DIV>
<DIV></DIV>testfile = fopen( FileName, "w" ) ;
<DIV></DIV>if( testfile == NULL )
<DIV></DIV>{
<DIV></DIV>printf( "\nUNABLE TO CREATE OUTPUT FILE! (ABNORMAL TERMINATION)\n" )
<DIV></DIV>;
<DIV></DIV>exit( 0 ) ;
<DIV></DIV>}
<DIV></DIV>
<DIV></DIV>fclose( testfile ) ;
<DIV></DIV>
<DIV></DIV>return 0 ;
<DIV></DIV>}
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>The program should be portable to UNIX too given that you provide the
<DIV></DIV>correct path syntax (/ for directories). Also why provide path anyway?
<DIV></DIV>(it will be created in the current path where the program is excuted).
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>Ioannis
<DIV></DIV>
<DIV></DIV>* Ioannis Vranos
<DIV></DIV>* Programming pages:
<DIV></DIV>http://www.noicys.d2g.com
<DIV></DIV>* Alternative URL: http://run.to/noicys
<DIV></DIV>
<DIV></DIV></div><br clear=all><hr>Join the worlds largest e-mail service with MSN Hotmail. <a href='http://go.msn.com/bql/hmtag4_etl_EN.asp'>Click Here</a><br></html>
|
|
From: Ioannis V. <no...@ya...> - 2002-02-28 13:24:46
|
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Benjamin
Wheeless
Sent: Thursday, February 28, 2002 3:05 PM
To: dev...@li...
Subject: RE: [Dev-C++] Time stamping an output file.
Morning,
First of all, thanks again Ioannis and Jason for the suggestions.
Secondly, I figured if anyone were interested, below is how I solved
this time stamp problem. It is not portable to a Unix/Unix-based
platform, but since the job on my end runs on an NT platform...it serves
the purpose that I need it to serve.
/*DATE STAMP TEST PROGRAM*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
FILE* testfile ;
char* PtrToFname ;
Not needed
char FileName[27] ;
time_t CurTime ;
struct tm* datetime ;
CurTime = time( NULL ) ;
datetime = localtime( &CurTime ) ;
strftime( FileName, 27, "C:\\temp\\hsloan%Y%m%d.txt", datetime ) ;
printf( "%s", FileName ) ;
PtrToFname = FileName ;
Not needed
testfile = fopen( PtrToFname, "w" ) ;
if( testfile == NULL )
{
printf( "\nUNABLE TO CREATE OUTPUT FILE! (ABNORMAL TERMINATION)\n" )
;
exit( 0 ) ;
}
fclose( testfile ) ;
return 0 ;
}
Thanks again everyone.
Benjamin Wheeless
Network Systems - Delta Airlines, Inc.
Atlanta, GA - USA 30320
==============================
So the program becomes:
/*DATE STAMP TEST PROGRAM*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
FILE* testfile ;
char FileName[27] ;
time_t CurTime ;
struct tm* datetime ;
CurTime = time( NULL ) ;
datetime = localtime( &CurTime ) ;
strftime( FileName, 27, "C:\\temp\\hsloan%Y%m%d.txt", datetime ) ;
printf( "%s", FileName ) ;
testfile = fopen( FileName, "w" ) ;
if( testfile == NULL )
{
printf( "\nUNABLE TO CREATE OUTPUT FILE! (ABNORMAL TERMINATION)\n" )
;
exit( 0 ) ;
}
fclose( testfile ) ;
return 0 ;
}
The program should be portable to UNIX too given that you provide the
correct path syntax (/ for directories). Also why provide path anyway?
(it will be created in the current path where the program is excuted).
Ioannis
* Ioannis Vranos
* Programming pages: <http://www.noicys.d2g.com/>
http://www.noicys.d2g.com
* Alternative URL: <http://run.to/noicys> http://run.to/noicys
|
|
From: Ioannis V. <no...@ya...> - 2002-02-28 13:24:44
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of h.r...@gm...
> Sent: Thursday, February 28, 2002 7:34 AM
> To: dev...@li...
> Subject: [Dev-C++] cannot compile matrix class
>
>
> Hello,
> I try the following example from Stroustrub "The C++
> programming language" ( the german edition), but it does not
> compile and I can't find the errors. Can everyone help me ?
> Thanks in advance greetings Horst
>
>
> the .h file:
>
> #ifndef array2D_H
> #define array2D_H
>
> #include <valarray>
#include <cstddef> // For size_t
using namespace std;
>
> class Matrix
> {
> valarray<double>* v;
> size_t d1, d2;
> public:
> Matrix (size_t x, size_t y);
> Matrix& Matrix(const Matrix&);
Constructor can't have a return value.
> Matrix& operator=(const Matrix&);
> ~Matrix();
>
> size_t size() const { return d1 * d2; }
> size_t dim1() const { return d1; }
> size_t dim2() const { return d2; }
> Slice_iter<double> zeile (size_t i);
> Cslice_iter<double> zeile (size_t i) const;
>
> Slice_iter<double> spalte (size_t i);
> Cslice_iter<double> spalte (size_t i) const;
Where are Slice_iter, e.t.c. types defined?
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
>
|
|
From: Benjamin W. <ben...@ho...> - 2002-02-28 13:05:42
|
<html><div style='background-color:'><DIV>
<P>Morning,</P>
<P>First of all, thanks again Ioannis and Jason for the suggestions.</P>
<P>Secondly, I figured if anyone were interested, below is how I solved this time stamp problem. It is not portable to a Unix/Unix-based platform, but since the job on my end runs on an NT platform...it serves the purpose that I need it to serve.</P>
<P>/*DATE STAMP TEST PROGRAM*/</P>
<P>#include <stdio.h><BR>#include <stdlib.h><BR>#include <time.h></P>
<P>int main()<BR>{<BR> FILE* testfile ;<BR> char* PtrToFname ;<BR> char FileName[27] ;<BR> time_t CurTime ;<BR> struct tm* datetime ;</P>
<P> CurTime = time( NULL ) ;<BR> datetime = localtime( &CurTime ) ;</P>
<P> strftime( FileName, 27, "C:\\temp\\hsloan%Y%m%d.txt", datetime ) ;</P>
<P> printf( "%s", FileName ) ;</P>
<P> PtrToFname = FileName ;</P>
<P> testfile = fopen( PtrToFname, "w" ) ;<BR> if( testfile == NULL )<BR> {<BR> printf( "\nUNABLE TO CREATE OUTPUT FILE! (ABNORMAL TERMINATION)\n" ) ;<BR> exit( 0 ) ;<BR> }</P>
<P> fclose( testfile ) ;</P>
<P> return 0 ;<BR>}<BR><BR>Thanks again everyone.</P></DIV>
<DIV></DIV>
<DIV><FONT face="Geneva, Arial, Sans-serif" size=2>Benjamin Wheeless</FONT></DIV>
<DIV></DIV>
<DIV><FONT face="Geneva, Arial, Sans-serif" size=2><STRONG>Network Systems - Delta Airlines, Inc.</STRONG></FONT></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><STRONG>Atlanta, GA - USA 30320</STRONG></FONT></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2><STRONG>==============================</STRONG></FONT></DIV>
<DIV> </DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>----Original Message Follows----
<DIV></DIV>From: "Ioannis Vranos" <NO...@YA...>
<DIV></DIV>To: "Dev-C++" <DEV...@LI...>
<DIV></DIV>Subject: RE: [Dev-C++] Time stamping an output file.
<DIV></DIV>Date: Mon, 25 Feb 2002 21:18:48 +0200
<DIV></DIV>
<DIV></DIV>I am sorry obviously i did not understand the question. I thought you
<DIV></DIV>wanted to manipulate the date/time stamp of the files, but you wanted to
<DIV></DIV>put a string to the filename. You can use the functions ctime() and
<DIV></DIV>time() of time.h in the style:
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>#include <STDIO.H>
<DIV></DIV>#include <STDLIB.H>
<DIV></DIV>#include <STRING.H>
<DIV></DIV>#include <TIME.H>
<DIV></DIV>
<DIV></DIV>int main(void)
<DIV></DIV>{
<DIV></DIV>char filename[]="some filename - ";
<DIV></DIV>time_t tp=time(NULL);
<DIV></DIV>char *s=ctime(&tp);
<DIV></DIV>char *newname=malloc(strlen(filename)+strlen(s)+1);
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>if(!newname)
<DIV></DIV>return EXIT_FAILURE;
<DIV></DIV>
<DIV></DIV>strcpy(newname, filename);
<DIV></DIV>strcat(newname, s);
<DIV></DIV>
<DIV></DIV>puts(newname);
<DIV></DIV>
<DIV></DIV>return 0;
<DIV></DIV>}
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>Keep in mind that this operation is portable, that is it works
<DIV></DIV>everywhere.
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>Ioannis
<DIV></DIV>
<DIV></DIV>* Ioannis Vranos
<DIV></DIV>* Programming pages:
<DIV></DIV>http://www.noicys.d2g.com
<DIV></DIV>* Alternative URL: http://run.to/noicys
<DIV></DIV>
<DIV></DIV>-----Original Message-----
<DIV></DIV>From: dev...@li...
<DIV></DIV>[mailto:dev...@li...] On Behalf Of Ioannis
<DIV></DIV>Vranos
<DIV></DIV>Sent: Monday, February 25, 2002 8:42 PM
<DIV></DIV>To: Dev-C++
<DIV></DIV>Subject: RE: [Dev-C++] Time stamping an output file.
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>You can do it with win32 api:
<DIV></DIV>
<DIV></DIV>Syntax
<DIV></DIV>
<DIV></DIV>#include <IO.H>
<DIV></DIV>int getftime(int handle, struct ftime *ftimep);
<DIV></DIV>int setftime(int handle, struct ftime *ftimep);
<DIV></DIV>
<DIV></DIV>[ Useless things ]
<DIV></DIV>
<DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_etl_EN.asp'>http://explorer.msn.com</a>.<br></html>
|
|
From: <h.r...@gm...> - 2002-02-28 05:34:06
|
Hello,
I try the following example from Stroustrub "The C++ programming language" (
the german edition), but it does not compile and I can't find the errors.
Can everyone help me ?
Thanks in advance
greetings
Horst
the .h file:
#ifndef array2D_H
#define array2D_H
#include <valarray>
class Matrix
{
valarray<double>* v;
size_t d1, d2;
public:
Matrix (size_t x, size_t y);
Matrix& Matrix(const Matrix&);
Matrix& operator=(const Matrix&);
~Matrix();
size_t size() const { return d1 * d2; }
size_t dim1() const { return d1; }
size_t dim2() const { return d2; }
Slice_iter<double> zeile (size_t i);
Cslice_iter<double> zeile (size_t i) const;
Slice_iter<double> spalte (size_t i);
Cslice_iter<double> spalte (size_t i) const;
double& operator() (size_t x, size_t y);
double operator() (size_t x, size_t y) const;
Slice_iter<double> operator() (size_t i) { return zeile(i); }
Cslice_iter<double> operator() (size_t i) const { return zeile(i); }
Slice_iter<double> operator[] (size_t i) { return zeile(i); }
Cslice_iter<double> operator[] (size_t i) const { return zeile(i); }
Matrix& operator*= (double);
valarray<double>& array() { return *v; };
};
#endif
the .cpp file:
#include "array2D.h"
slice_array<double> zeile (size_t i)
{
return (*v)(slice(i, d1, d2));
}
inline Slice_iter<double> Matrix::zeile(size_t i)
{
return Slice_iter<double>(v, slice(i, d1, d2));
}
inline Cslice_iter<double> Matrix::zeile(size_t i) const
{
return Cslice_iter<double>(v, slice(i, d1, d2));
}
inline Slice_iter<double> Matrix::spalte(size_t i)
{
return Slice_iter<double>(v, slice(i*d2, d2, 1));
}
inline Cslice_iter<double> Matrix::spalte(size_t i) const
{
return Cslice_iter<double>(v, slice(i*d2, d2, 1));
}
Matrix::Matrix(size_t x, size_t y)
{
d1 = x;
d2 = y;
v = new valarray<double>(x*y);
}
double& Matrix::operator()(size_t x, size_t y)
{
return zeile(x)[y];
}
double Matrix::operator()(size_t x, size_t y) const
{
return zeile(x)[y];
}
double mul(const valarray<double>& v1, const valarray<double>& v2)
{
double res = 0;
for (int i = 0; i < v1.size(); i++)
res += v1[i] * v2[i];
return res;
}
valarray<double> operator*(const Matrix& m, const valarray<double>& v)
{
valarray<double> res(m.dim1());
for (int i = 0; i < m.dim1(); i++)
res(i) = mul(m.zeile(i), v);
return res;
}
Matrix& Matrix::operator*=(double d)
{
(*v) *= d;
return *this;
}
Error messages:
In file included from c:\dev\dev-c++\arrhenius\array2d.cpp:1:
c:/dev/dev-c++/arrhenius/array2D.h:12: return type specification for
constructor invalid
c:/dev/dev-c++/arrhenius/array2D.h:20: syntax error before `('
c:/dev/dev-c++/arrhenius/array2D.h:21: syntax error before `('
c:/dev/dev-c++/arrhenius/array2D.h:23: syntax error before `('
c:/dev/dev-c++/arrhenius/array2D.h:24: syntax error before `('
c:/dev/dev-c++/arrhenius/array2D.h:29: syntax error before `operator'
c:/dev/dev-c++/arrhenius/array2D.h:30: syntax error before `operator'
c:/dev/dev-c++/arrhenius/array2D.h:32: syntax error before `operator'
c:/dev/dev-c++/arrhenius/array2D.h:33: syntax error before `operator'
c:/dev/dev-c++/arrhenius/array2D.h:35: `operator *=(double)' must have an
argument of class or enumerated type
c:/dev/dev-c++/arrhenius/array2D.h:35: `operator *=(double)' must take
exactly two arguments
c:/dev/dev-c++/arrhenius/array2D.h: In function `class valarray<double> &
array()':
c:/dev/dev-c++/arrhenius/array2D.h:37: `v' undeclared (first use this
function)
c:/dev/dev-c++/arrhenius/array2D.h:37: (Each undeclared identifier is
reported only once
c:/dev/dev-c++/arrhenius/array2D.h:37: for each function it appears in.)
c:/dev/dev-c++/arrhenius/array2D.h: At top level:
c:/dev/dev-c++/arrhenius/array2D.h:38: parse error before `}'
c:\dev\dev-c++\arrhenius\array2d.cpp: In function `class slice_array<double>
zeile(unsigned int)':
c:\dev\dev-c++\arrhenius\array2d.cpp:5: `d1' undeclared (first use this
function)
c:\dev\dev-c++\arrhenius\array2d.cpp:5: `d2' undeclared (first use this
function)
c:\dev\dev-c++\arrhenius\array2d.cpp: At top level:
c:\dev\dev-c++\arrhenius\array2d.cpp:8: syntax error before `::'
c:\dev\dev-c++\arrhenius\array2d.cpp:13: syntax error before `::'
c:\dev\dev-c++\arrhenius\array2d.cpp:18: syntax error before `::'
c:\dev\dev-c++\arrhenius\array2d.cpp:23: syntax error before `::'
c:\dev\dev-c++\arrhenius\array2d.cpp: In method `double & Matrix::operator
()(unsigned int, unsigned int)':
c:\dev\dev-c++\arrhenius\array2d.cpp:37: no match for
`slice_array<double>[size_t &]'
c:\dev\dev-c++\arrhenius\array2d.cpp: In method `double Matrix::operator
()(unsigned int, unsigned int) const':
c:\dev\dev-c++\arrhenius\array2d.cpp:42: no match for
`slice_array<double>[size_t &]'
c:\dev\dev-c++\arrhenius\array2d.cpp: In function `class valarray<double>
operator *(const Matrix &, const valarray<double> &)':
c:\dev\dev-c++\arrhenius\array2d.cpp:57: no match for call to
`(valarray<double>) (int &)'
c:\dev\dev-c++\arrhenius\array2d.cpp:57: no matching function for call to
`Matrix::zeile (int &) const'
c:\dev\dev-c++\arrhenius\array2d.cpp: At top level:
c:\dev\dev-c++\arrhenius\array2d.cpp:62: no `class Matrix & Matrix::operator
*=(double)' member function declared in class `Matrix'
--
--------------------------
Horst Rößner
Postf. 1802
52205 Stolberg
02402 / 6178
0171 6455636
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
|
|
From: carlos D. M. <cg...@wo...> - 2002-02-27 17:05:53
|
The line
system("app.exe");
will run the program app.exe.
For opening the help.html when pressing H type:
if(*******=='H')
system("start harddisk:/fullpath/help.html");
Till now I don't achieve to do it with filenames which use spaces. It must be
done as with the command prompt, cmd.exe, but I try everything and nothing
works
Gareth escribió:
> This is my 1st post on the mailing list so don't shout at me if it all goes
> wrong !!
>
> I just want to know I can open a .html or .doc file etc from within my C
> programme from an option screen where the user types for example H for help
> which will then launch my help.htm page.
>
> I want to do this in either C or C++ but can't find any code that allows me
> to run other applications from options in my prog.
>
> Thanx in advance.
> Gaz.
>
> -----------------------------------------------------------------
> Web: www.DjGaz.cjb.net
> BT Mobile: 07713291858
> ICQ: 60074512
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Joerg B. <jo...@sq...> - 2002-02-27 14:42:30
|
Hi,
sorry about the crosspost, but I do not know the universe where
the question arose.
Gareth wrote:
>
> This is my 1st post on the mailing list so don't shout at me if it all goes
> wrong !!
You sent it to three lists, so probably no-one knows in which
"world" you program. As the answer to your question very much
depends on your environment, please select _one_ list only.
If you forgot that:
"Cygwin" tries to put a Unix-like world on top of Windows,
whereas "MinGW" makes the Windows libraries accessible to
Unix-like compilers and tools,
about "dev-cpp" I have no knowledge.
Regards,
Joerg Bruehe
--
Joerg Bruehe, SQL Datenbanksysteme GmbH, Berlin, Germany
(speaking only for himself)
mailto: jo...@sq...
|
|
From: Gareth <DjG...@Ho...> - 2002-02-27 13:31:32
|
This is my 1st post on the mailing list so don't shout at me if it all goes wrong !! I just want to know I can open a .html or .doc file etc from within my C programme from an option screen where the user types for example H for help which will then launch my help.htm page. I want to do this in either C or C++ but can't find any code that allows me to run other applications from options in my prog. Thanx in advance. Gaz. ----------------------------------------------------------------- Web: www.DjGaz.cjb.net BT Mobile: 07713291858 ICQ: 60074512 |
|
From: <je...@i3...> - 2002-02-27 12:37:58
|
On Tue, 26 Feb 2002, Karin E. Hacker wrote: > "This is because Microsoft introduced the concept of the CLR, or common > language runtime. What that means is two of the languages offered by > Microsoft, VB.Net and C#, both share the same runtime." > - <http://zdnet.com.com/2100-1107-842922.html> > > Dose anyone else out there in the GCC universe feel the slightest twinge of > irritation at the fact that Microsoft is once again getting credit for > another stolen and repackaged concept? Not quite sure what you mean. What's novel about the CLR is that all languages utilizing the CLR share a common object model. Implement a class in one language, instances are visible in another language: methods, properties and all. It also allows for classes to be derived in languages other from those in which the base class is written. GCC doesn't really have the same concept. The GNU C++, Fortran, Ada and Java runtimes are all disjoint. The closest it comes is that gcj (GNU Java) objects are visible to g++. But the reverse is not true, so it is an assymetric relationship. Jeff |
|
From: scott h <sco...@ya...> - 2002-02-27 03:09:21
|
please remove me from your mailing list __________________________________________________ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.yahoo.com |
|
From: scott h <sco...@ya...> - 2002-02-27 03:08:16
|
please remove me from your mailing list __________________________________________________ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.yahoo.com |
|
From: Ioannis V. <no...@ya...> - 2002-02-27 01:15:46
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Karin E. Hacker > Sent: Wednesday, February 27, 2002 2:36 AM > To: cy...@cy...; min...@li...; > dev...@li... > Subject: [Dev-C++] RE: The developer's dilemma > > > "This is because Microsoft introduced the concept of the CLR, > or common language runtime. What that means is two of the > languages offered by Microsoft, VB.Net and C#, both share the > same runtime." > - <http://zdnet.com.com/2100-1107-842922.html> > > Dose anyone else out there in the GCC universe feel the > slightest twinge of irritation at the fact that Microsoft is > once again getting credit for another stolen and repackaged concept? In spite of the fact that i like the open source movement, i do not think MS stole anything from anyone on this particular matter. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys |
|
From: Karin E. H. <em...@sh...> - 2002-02-27 00:39:41
|
"This is because Microsoft introduced the concept of the CLR, or common language runtime. What that means is two of the languages offered by Microsoft, VB.Net and C#, both share the same runtime." - <http://zdnet.com.com/2100-1107-842922.html> Dose anyone else out there in the GCC universe feel the slightest twinge of irritation at the fact that Microsoft is once again getting credit for another stolen and repackaged concept? ---------- Live long and prosper, Karin E. Hacker ==================== (band) em...@sh... <http://www.shillelaghlaw.com> (retirement) ka...@ha... <http://www.hackergrafix.com> (hobby) ka...@us... <http://www.sourceforge.net> (work) kh...@co... <http://www.computereng.com> ==================== Give a hobbit a ghoti and he eats for a day. Give a hobbit a Ring and he eats for an Age. ==================== |
|
From: <gi...@li...> - 2002-02-26 17:51:10
|
Hi, I tried adding "wildargs.obj" and it works. Now, I have the same output, independent of which of the two compilers I use to generate the executable. Thanks. At 17:12 25/02/02 +0100, jansb000 wrote: >The usage of wildcards in unix ... >... >For BCC you can get the arguments as-is, this it what we see here, or you >can link the file "wildargs.obj" in your project. That should give you the >same results as with DJGPP or MINGW32. (I found this in my old Turbo C++ 3.0 >users guide). -- gisan gi...@li... |