dev-cpp-users Mailing List for Dev-C++ (Page 391)
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: michel.weinachter <mic...@fr...> - 2003-04-26 19:54:05
|
(bonjour,)
hello,
You could find in your dev-c++ directory a new folder docs with various
files. The most important is wx.chm file.
Zero : read "topics overview"->
*Notes on using the reference* <wx450.htm#referencenotes>
*Writing a wxWindows application: a rough guide* <wx451.htm#roughguide>
*wxWindows Hello World sample* <wx452.htm#helloworld>
*wxWindows samples* <wx453.htm#samples>
*wxApp overview* <wx454.htm#wxappoverview>
First create a new wxwindows project and read the comments.
Second compile it click on the classes tab : you now have the list off
all the classes of the project .
You could also add in the editor properties->completion the file
include\wx\wx.h (very useful).
you can create a button add
wxButton *toto= new wxButton(frame, 2, "this is a test");
toto->SetBackgroundColour(wxColour(120,0,0));
just after :
---------
bool MyApp::OnInit()
{
// create the main application window
MyFrame *frame = new MyFrame(_T("Minimal wxWindows App"),
wxPoint(50, 50), wxSize(450, 340));
-------------
this way is not the best, but it's very simple.
You could download wxwindows for windows at :
http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.4.0-setup.zip
In the samples directory you will find a lot of examples
and
http://prdownloads.sourceforge.net/wxwindows/wxWindows-2.4.0-WinHelp.
for the winhelp file that you can add to the dev-cpp help menu.
finaly, if you want build complex apps use the xrc contrib (that should
be in the main library soon). To edit xrc files I am using xrced
provided with wxPython.
bye
|
|
From: <and...@su...> - 2003-04-26 18:36:58
|
Dear Users
I am together with theese needs presented here. In 1991 I developed a
Fax board for an 286 ISA bus PC, and the bibliography at that time was only:
1-HALL, Douglas V., "Microprocessors and Interfacing". MGrwaw-Hill´86
It was a book that we could find ANYTHING about PC hardware! bus
controller, Interrupt controller, timming, DMA controller, blah,
blah and a lot of blah!
2-One good book of C Programming Language, together with another book
of DOS graphic routines;
3-One additional manual of the IBM PC;
With this little manual, we could send information to the paralel port
serial port, it told us what was the address of this ports, the free
interrupts, and we only needed to make outport and inport commands;
-In my case of my project, three additional books involving the DSP that
I used on the board, a telecomunnications principles (CRC, HDLC
protocols, blah, etc, blah) handbook and a manual for understand
the old
PCX image pattern;
-AND ONLY THIS! GENTLEMEN! With this books, and a hot black coffee we went
to the lab, spent some months, and the board was made (of course with hard
additional difficulties!).
But... the sources were clear!
Everything that I find nowadays is Microsoft´s Wizzard guided... I cannot
find direct information about Pentium architecture, how to access it, how
to write a simple program to send/receive some information via USB, or
paralell port.
My Questions:
A) What serious list (like this list) do you recommend to get answers for
actual bibliography of items 1, 2 and 3 above (in the case of 2 for Win32);
B) In the case of Linux, what list and what distribution is the best to
develop device-drivers: Debian, Red Hat, slack,...?
Thank you in advance
Andre
>XXXXXXXXXXXXXXXXXX
>
>Message: 5
>From: Christian Wallukat <Chr...@vo...>
>To: "Dev-Cpp-Users@Lists. Sourceforge. Net (E-Mail)"
> <dev...@li...>
>Date: Fri, 25 Apr 2003 10:59:56 +0200
>Subject: [Dev-C++] (no subject)
>
>
>Hi List,
>
>
>
>in the good old days of DOS we had the possibility to check the state of
the
>RS232 ports.
>
>(In Basic I have tested if GND and another port was connected inp(PORT +
>PIN) )...
>
>How can i realise that in cpp under win32 ???
>
>I have to check if a circuit is closed (alert system)...
>
>
>I know that you can not longer get direct access to the hardware ...
>
>XXXXXXXXXXXXXXXXXXX
>
>Message: 6
>From: Dondolo Mpho <MDo...@OL...>
>To: "Dev-Cpp-Users@Lists. Sourceforge. Net (E-Mail)"
> <dev...@li...>
>Date: Fri, 25 Apr 2003 11:31:33 +0200
>Subject: [Dev-C++] HI
>
>This message is in MIME format. Since your mail reader does not understand
>this format, some or all of this message may not be legible.
>
>------_=_NextPart_001_01C30B0D.75E38030
>Content-Type: text/plain;
> charset="ISO-8859-1"
>
>Hi Guys,
>
>Can anybody help me. I need a code that will be able to read and display
the
>model, make, and other stuff of hardware. For example, the info your
>harddrive, CDROM, Memory .ect.ect.ect.
>
>I want to understand how to communicate with your hardware.
>
>Regards,
>
>Mpho Dondolo
>Support Analyst
>Computer Sciences Corp. (CSC)
>Tel: +27 21 503 0059
>Fax: +27 21 509 5619
>Cell: +27 84 337 1468
>mdo...@cs...
>mdo...@ol...
|
|
From: <and...@su...> - 2003-04-26 17:54:00
|
Dear Users,
---> Some students are using a mix of commands and features like:
/* and //
getchar() and cin.get()
<stdio.h> and <iostream>
<stdlib.h> and <cstdlib>
printf and cout
scanf and cin
.c and .cpp
"A"---> I´ve tried some enable/disabe options inside
"Options->Compiler Options->C/C++ Compiler", but couldn´t
inhibt the students to write codes mixing the commands.
The corrections are still by hand. Sometimes is difficult
to explain for some guys that come with vicious what a C or
a C++ program is.
---> My Questions:
1) Is my attempt to convince them correct?
2) If it is, is there any set of options that allows me to inhibt to mix
C and C++ features?
Regards
Andre
|
|
From: Zodiaq <zo...@ac...> - 2003-04-26 16:19:05
|
Hello Daniel and all Dev-C++ users,
Saturday, April 26, 2003, 5:34:24 PM, Daniel wrote as follows:
DG> Hi, I'm using the Half Life SDK and am confused by the ampersand symbol, can
DG> anyone explain what's happening please?
DG> inline BOOL HasConditions( int iConditions ) { if ( m_afConditions &
DG> iConditions ) return TRUE; return FALSE; }
DG> I also notice we have return TRUE; return FALSE; I'm assuming this is
DG> perfectly valid as in
DG> if (condition)
DG> return TRUE;
DG> // if condition was true we would have exited by now.
DG> return FALSE;
DG> This isn;t relating to HL, it's just a general question about the
DG> conditional statement. Is it something to do with bit masking?
Yeah, look at this simple sample (I used something very similar in
PHP):
unsigned int uiTypeA = 1; //bits: 00000001
unsigned int uiTypeB = 2; //bits: 00000010
unsigned int uiTypeC = 4; //bits: 00000100
unsigned int uiTypeD = 8; //bits: 00001000
unsigned int uiTypeAC = uiTypeA | uiTypeC; // == 5,bits: 00000101
and now checking:
//uiTepeNew
if( uiTypeNew & uiTypeA )//is bit 00000001 set??
;//do something here
if( uiTypeNew & uiTypeB )//is bit 00000010 set??
;//do something here
if( uiTypeNew & uiTypeA and uiTypeNew & uiTypeB )//are bits one and two set??
;//do some...
and this is something very different:
if( uiTypeNew & uiTypeAB )
;//do some...
which means if one (or both) of uiTypeA or uiTypeB set?? This is like
logical OR, and equal to:
if( uiTypeNew & uiTypeA or uiTypeNew & uiTypeB )
this bit feauture might be used to send few options (type yes/no) in
one variable... sometimes VERY USEFUL - use only if needed, don't
force it into your progs...
--
regards, Zodiaq
|
|
From: <cg...@wo...> - 2003-04-26 16:12:06
|
It's performing the logical AND operation with m_afConditions and
iConditions, if the result is different from zero (true) return true,
else return false. (Notice that would be shorter do [...]{return
m_afConditions & iConditions;})
To be true at least one of the bits which is set in m_afConditions has
to be in iConditions.
AND true table:
1 AND (&) 1 = 1 (true)
1 AND (&) 0 = 0 (false)
0 AND (&) 1 = 0 (false)
0 AND (&) 0 = 0 (false)
Daniel Glenfield wrote:
> Hi, I'm using the Half Life SDK and am confused by the ampersand
> symbol, can anyone explain what's happening please?
>
> inline BOOL HasConditions( int iConditions ) { if ( m_afConditions &
> iConditions ) return TRUE; return FALSE; }
>
> I also notice we have return TRUE; return FALSE; I'm assuming this is
> perfectly valid as in
>
> if (condition)
> return TRUE;
>
> // if condition was true we would have exited by now.
> return FALSE;
>
> This isn;t relating to HL, it's just a general question about the
> conditional statement. Is it something to do with bit masking?
>
>
>
>
>
> _________________________________________________________________
> Surf together with new Shared Browsing
> http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID=74&DI=1059
>
>
>
> -------------------------------------------------------
> 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
>
|
|
From: <cg...@wo...> - 2003-04-26 16:05:28
|
Let me throw a guess: have you see if you have set Shift + . (Or whatever is in your keyboard. In mine that's ;) as a shortcut for something which result is not seen? See in tools->configure shortcuts and search it, you can quit it by pressing Esc while it is selected. Neszt Tibor wrote: >Hello! > > > >>Yes knowing that you are using the hungarian keyboard is important (at least >>I think it is!!!). >> >>So the semicolon works fine in all applications except in dev-c++ ? The only >>thing I'd recommend is changing your settings in control panel to use a >>different character set for your keyboard. I'm afraid I'm not sure what else >>you could do. >> >>Oh hang on, have you tried typing ; in notepad or somewhere, and in Dev-C++ >>doing a paste to put the semi colon in? What happens this way? Does the semi >>colon appear, or do you get nothing, or some garbage character? Could be to >>do with unicode/dbcs/ascii perhaps. >> >> > >Yes, the paste is works! Now that is the only way me to type ";" in devc. >I can tell You, the same key, which I use to type ";" in all other >applications, do nothing in the devc. I mean no character apperars, after >pressing it. > > > >Ioannis Vranos: > > > >>Then you can add the English (American) keyboard langage with keyboard >>layout US, and use it to write your code. >> >> > >Yes, as I said, I tried all of windows keyboard setting also. But here is >a curious thing. When I start the devc, the key setting automatical switch >to Hungarian. After that I can switch back manually to American, but the >semicolon till not available. > > >So, thanks for You to pay attention, and I'm waiting for You new solution >tips. :) > >Regards, > >Neszt Tibor > > > >------------------------------------------------------- >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 > > > |
|
From: Daniel G. <sp...@ho...> - 2003-04-26 15:34:30
|
Hi, I'm using the Half Life SDK and am confused by the ampersand symbol, can
anyone explain what's happening please?
inline BOOL HasConditions( int iConditions ) { if ( m_afConditions &
iConditions ) return TRUE; return FALSE; }
I also notice we have return TRUE; return FALSE; I'm assuming this is
perfectly valid as in
if (condition)
return TRUE;
// if condition was true we would have exited by now.
return FALSE;
This isn;t relating to HL, it's just a general question about the
conditional statement. Is it something to do with bit masking?
_________________________________________________________________
Surf together with new Shared Browsing
http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID=74&DI=1059
|
|
From: <ca...@kr...> - 2003-04-26 13:13:42
|
> #define BUFFER_MAX_SIZE 4096 // <- I think this limit is even
> // used in the bash
I thought about using a small buffer for starters and then reallocate
memory when needed but that seemed much to inefficient to me, since
realloc whether adds very often very little space or not so often a
lot of space to the string. so you either end up with very much
performance on reallocating tiny additions to the buffer or with a
too long buffer in which case you could've use a large buffer in the
first place. so that's what I'm doing I guess. ;)
gruss
/Christian mailto:ca...@kr...
---
I propose that the following character sequence for joke markers:
:-)
19-Sep-82 11:44 Scott E Fahlman
|
|
From: <ca...@kr...> - 2003-04-26 13:05:05
|
hi!
ok, then I got down to this little snippet. thanks to your help.
a buffer overflow won't come I think but can there be a EOF before
'\n' on stdin???
<snip>
#define BUFFER_MAX_SIZE 4096 // <- I think this limit is even
// used in the bash
int i = 0;
char c;
char buffer[BUFFER_MAX_SIZE];
while((c = getchar()) != '\n')
if(i < BUFFER_MAX_SIZE) buffer[i++] = (c == '\n') ? 0 : c;
</snap>
gruss
/Christian mailto:ca...@kr...
---
I propose that the following character sequence for joke markers:
:-)
19-Sep-82 11:44 Scott E Fahlman
|
|
From: Ioannis V. <iv...@at...> - 2003-04-26 10:19:11
|
> -----Original Message----- > From: Ioannis Vranos [mailto:iv...@at...]=20 > Sent: Saturday, April 26, 2003 1:17 PM > To: 'Dev-C++ Mailing List' > Subject: RE: [Dev-C++] how to do a shell like input.. >=20 >=20 >=20 >=20 > > -----Original Message----- > > From: dev...@li...=20 > > [mailto:dev...@li...] On Behalf=20 > > Of Christian Sch=E4fer > > Sent: Saturday, April 26, 2003 10:29 AM > > To: Dev-C++ Mailing List > > Subject: [Dev-C++] how to do a shell like input.. > >=20 > >=20 > > hi Dev-C++, > > [this is a followup thread to 'stdin reset..'] > >=20 > > I want to programm a shell-like interface for my=20 > application, in which > > I know some special commands with options and arguments. > >=20 > > the problem I have is, how do I create an input-buffer, that is able > > to hold whatever is read from stdin, since i can not say=20 > what would be > > the longest valid entry (say cat some large text...). > >=20 > > is there a way to dynamically read the length of the=20 > inputstring up to > > the first '\n' and then malloc some string and THEN scanf() ??? >=20 >=20 > You can use a temporary buffer in the automatic storage of a=20 > fixed size where you will store using getchar(), and then use=20 > malloc() and realloc() to allocate the necessary space on the=20 > free store and strcat() from the temp buffer... In C++ you=20 > would simply do: >=20 >=20 > string s; >=20 > while(cin>>s) > ; The above C++ thing would read only up to the first whitespace = character. So forget it anyway. Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: Ioannis V. <iv...@at...> - 2003-04-26 10:17:05
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of Christian Sch=E4fer
> Sent: Saturday, April 26, 2003 10:29 AM
> To: Dev-C++ Mailing List
> Subject: [Dev-C++] how to do a shell like input..
>=20
>=20
> hi Dev-C++,
> [this is a followup thread to 'stdin reset..']
>=20
> I want to programm a shell-like interface for my application, in which
> I know some special commands with options and arguments.
>=20
> the problem I have is, how do I create an input-buffer, that is able
> to hold whatever is read from stdin, since i can not say what would be
> the longest valid entry (say cat some large text...).
>=20
> is there a way to dynamically read the length of the inputstring up to
> the first '\n' and then malloc some string and THEN scanf() ???
You can use a temporary buffer in the automatic storage of a fixed size
where you will store using getchar(), and then use malloc() and =
realloc() to
allocate the necessary space on the free store and strcat() from the =
temp
buffer... In C++ you would simply do:
string s;
while(cin>>s)
;
Ioannis Vranos
=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
Anti-racism movement: http://www.positive-youthfoundation.org
Iraq Peace Pledge: http://www.peacepledge.org
Ioannis Vranos
=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
Anti-racism movement: http://www.positive-youthfoundation.org
Iraq Peace Pledge: http://www.peacepledge.org
|
|
From: jp <rar...@xt...> - 2003-04-26 08:12:06
|
how come u only can come for 1.500000 days? ----- Original Message ----- From: <dev...@li...> To: <dev...@li...> Sent: Saturday, April 26, 2003 3:04 PM Subject: Dev-cpp-users digest, Vol 1 #1429 - 9 msgs > Send Dev-cpp-users mailing list submissions to > dev...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > or, via email, send a message with subject or body 'help' to > dev...@li... > > You can reach the person managing the list at > dev...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Dev-cpp-users digest..." > > > Today's Topics: > > 1. RE: is the preprocessor considered harmful? (Pierre Raoul) > 2. RE: stdin reset... (Ioannis Vranos) > 3. RE: missing ";" (Ioannis Vranos) > 4. Re[2]: [Dev-C++] stdin reset... (=?ISO-8859-7?B?Q2hyaXN0aWFuIFNjaORmZXI=?=) > 5. Re: General question / remark (David Matthews) > 6. RES: Re[2]: [Dev-C++] stdin reset... (Daniel K. O.) > 7. RES: [Dev-C++] General question / remark (Daniel K. O.) > 8. Kip Warner leaves the project (Colin Laplace) > 9. RE: Re[2]: [Dev-C++] stdin reset... (Ioannis Vranos) > > --__--__-- > > Message: 1 > From: "Pierre Raoul" <pie...@wa...> > To: "Sourceforge. Net Dev-Cpp-Users@Lists." <dev...@li...> > Subject: RE: [Dev-C++] is the preprocessor considered harmful? > Date: Fri, 25 Apr 2003 22:26:32 +0200 > > > > "jp" <rar...@xt...> on Fri, 25 Apr 2003 07:27:16 +1200 wrote: > > > Hi, > >=20 > > This isn't a Dev-Cpp question, but I'd be interested in anyone's=20 > > thoughts... > >=20 > > If I'm using C++, I avoid using the preprocessor for anything except > > #include's and #pragma's. > >=20 > > The directives I most despise are #line, as suffered by users of = > lex/yacc, > > esql, and other source code generators, and ... > >=20 > > #ifdef ENTIRELY_STUPID_FEATURE_FOR_ANNOYING_CLIENT > > void stupid(); > > #endif > >=20 > > If I need a constant I use, eg, enum{SOMETHING=3D0xffffffff}; One of = > the > > benefits is that such constants are scoped. It bugs me when I want, = > eg, > > enum{ERROR=3D0xffffffff}; and ERROR has already been #defined in a = > header... > > Sometimes, wash my mouth out, I #undef, eg, ERROR.. > >=20 > > If I need a macro I use... > > template <typename someT> void xargle( someT& thing) > > { > > xargle_buffer << thing; > > } > >=20 > > BUT, and here's the point of my question, I don't know of any way to > > stringize or token paste without using the preprocessor. I have=20 > > a lisp. Not > > literally, like thith, but a library I've written. Built in types are > > instantiated using templates, so that, given a constant type id (eg: > > INTEGER), I can add a new type like so.. > >=20 > > DECLTYPE(int, INTEGER, Integer) > >=20 > > the macro DECLTYPE looks like this... > >=20 > > #define DECLTYPE(T, I, n)typedef imp::ImplObject<T, I> n;\ > > bool is##n(const Object &obj);\ > > const T &get##n(const Object &obj);\ > > T &ref##n(const Object &obj); > >=20 > > and there is an equally brief IMPLTYPE. > > The library allows constructions like.. > >=20 > > Object thing =3D String("gimme five: "); > > String s =3D thing; > > Integer i =3D 4; > > thing =3D i; > >=20 > > refInteger(thing)++; > > cout << s << thing; > >=20 > > = > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > This all works pretty well, and my lisp handles multimedia, ISAM, COM, > > sockets and other exotica in a fully object oriented, but=20 > > typesafe, manner. > > But FUNGLTYPE is a macro, and like I say, #define's are for grannies, = > so.. > > ..does anybody know of an alternative to macros for generating = > identifiers > > from user supplied fragments? > >=20 > > Cheers, > > jp. > > I'm not sure to fully understand your need, but may be you can get some = > ideas here: > > Chap. 3 "Typelists", Modern C++ Design, Andrei Alexandrescu, Addison = > Wesley ed. > > or else: > > http://www.cuj.com/experts/2002/alexandr.htm?topic=3Dexperts > > http://www.research.ibm.com/designpatterns/pubs/ph-jun00.pdf > > with the loki library here: > > http://sourceforge.net/projects/loki-lib/ > > Regards > > Pierre Raoul > > > > --__--__-- > > Message: 2 > From: "Ioannis Vranos" <iv...@at...> > To: <dev...@li...> > Subject: RE: [Dev-C++] stdin reset... > Date: Fri, 25 Apr 2003 23:33:16 +0300 > > > -----Original Message----- > > From: dev...@li...=20 > > [mailto:dev...@li...] On Behalf=20 > > Of Christian Sch=E4fer > > Sent: Friday, April 25, 2003 3:30 PM > > To: dev...@li... > > Subject: Re: [Dev-C++] stdin reset... > >=20 > >=20 > > > -stdin gets cleared > > > how can i do that? > >=20 > > fflush(stdin); > >=20 > > just found out how.. thanks anyway! > > > Which is not safe. getchar(), fgets(), etc, should be used instead, > > > > > Ioannis Vranos > =20 > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > Anti-racism movement: http://www.positive-youthfoundation.org > Iraq Peace Pledge: http://www.peacepledge.org > > > > > --__--__-- > > Message: 3 > From: "Ioannis Vranos" <iv...@at...> > To: "Dev-C++ Mailing List" <dev...@li...> > Subject: RE: [Dev-C++] missing ";" > Date: Fri, 25 Apr 2003 23:36:08 +0300 > > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...] On Behalf > > Of Neszt Tibor > > Sent: Friday, April 25, 2003 4:23 PM > > To: Daniel Glenfield > > Cc: dev...@li... > > Subject: Re: [Dev-C++] missing ";" > > > > > > > ok let's find out a few things. If you open notepad or > > another text editor > > > can you type a semi colon? If you can, you'll need to > > reinstall DEV. If not, > > > you need to reinstall your OS or, if a special keyboard, > > the keyboard > > > driver. > > > > Reinstall OS :-))))) > > > > Oh, funny, You don't understand me. Of course, I can type > > semicolon all of > > my other programs. Need to reintall devc++? How many times? > > If You read > > my letter thoughtfully, You can see, I tried many version of devc++. > > Moreover! In the meantime, I tried to install devc++ to 4 > > other computers, > > and the semicolor is missing on all of them. > > I'm sure the problem is NOT in the devc++. > > I use hungarian keyboard, if it is important. (Any other > > hungarian user > > here?) > > > > Regards, > > > > Neszt Tibor > > > > P.s.: To see, I can type semicolon here... ;;;;;;;;;;; > > > Then you can add the English (American) keyboard langage with keyboard > layout US, and use it to write your code. > > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > Anti-racism movement: http://www.positive-youthfoundation.org > Iraq Peace Pledge: http://www.peacepledge.org > > > > > --__--__-- > > Message: 4 > Date: Fri, 25 Apr 2003 22:55:15 +0200 > From: =?ISO-8859-7?B?Q2hyaXN0aWFuIFNjaORmZXI=?= <ca...@kr...> > Reply-To: =?ISO-8859-7?B?Q2hyaXN0aWFuIFNjaORmZXI=?= <ca...@kr...> > To: dev...@li..., "Ioannis Vranos" <iv...@at...> > CC: dev...@li... > Subject: Re[2]: [Dev-C++] stdin reset... > > hi Ioannis, > > >> > -stdin gets cleared > >> > how can i do that? > >> > >> fflush(stdin); > > Which is not safe. getchar(), fgets(), etc, should be used instead, > > and why is that? > I am very interested in code security issues but at least i want to > understand instead of obey them. so what exactly is considered > 'unsafe'? > > what I need is a secure way to read as much as there is from stdin > undtil '\n' into a char* buffer. I want that buffer to match the > needed length (I don't know how to do that, since I don't know the > exact needed length until i read it from stdin...) and I need to avoid > buffer overflows (of course). > I thought scanf() is a good way, since it reads only a specified > number of characters right? (ok, this is just a workaround, I guess..) > > I don't think this is a unique problem so there must be a known way to > solve it, is there? > > gruss > /Christian mailto:ca...@kr... > > --- > > > I propose that the following character sequence for joke markers: > > :-) > > 19-Sep-82 11:44 Scott E Fahlman > > > > --__--__-- > > Message: 5 > Date: Fri, 25 Apr 2003 17:02:02 -0400 > To: Janos Blazi <jb...@gm...>, dev...@li... > From: David Matthews <dem...@uw...> > Subject: Re: [Dev-C++] General question / remark > > Well, gdb is already integrated with Dev-C++. It doesn't have the best > interface, IMHO, so there's also the Insight frontend (available on > www.bloodshed.com/dev/) Of course, it screws up the Dev-C++ 5 betas so you > can't get rid of it. > > At 04:55 PM 25/04/2003 +0200, Janos Blazi wrote: > >After having played with Dec-C++ for a few days, here is what I see: > >The IDE that Dev-C++ is so good that I should probably never use Emacs for > >programming any more. It (Dev-C++) is so much better than MVC++6. > > > >So the only problem (as far as I and probably many other people are > >concerned) is the lack of a decent debugger. I do not know how difficult it > >is to write a MVC++6 style debugger but that debugger is excellent. > >Now I just thought: The Watcom sources should be be free by now; so > >wouldn't it be possible to look at that code and learn how they implemented > >their debugger (which almost paralleled the MVC++ debugger) and write your > >own debugger. Taken the genuine devotion of the Dev-C++ team (othwewise > >they could not have created such a nice product) it would be only a > >question of until they woul produce even a better debugger. > > > >Is this suggestion completely stupid? Is any work being done on a debugger > >vor Dev-C++? > > > >(As for the quality of the compiler, for most applications it is not that > >decisive.) > > > >At the moment I use Dev-C++ and for the tricky parts MVC++6. Anyway, thx > >for this great product. > > > >-- > >EG > > > > > >------------------------------------------------------- > >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 > > > > > --__--__-- > > Message: 6 > From: "Daniel K. O." <dan...@ya...> > To: "Christian Schafer" <ca...@kr...>, > <dev...@li...> > Subject: RES: Re[2]: [Dev-C++] stdin reset... > Date: Fri, 25 Apr 2003 18:57:51 -0300 > > > > > >> fflush(stdin); > > > Which is not safe. getchar(), fgets(), etc, should be used instead, > > > > and why is that? > > I am very interested in code security issues but at least i want to > > understand instead of obey them. so what exactly is considered > > 'unsafe'? > > > > The same reason you shouldn't fflush(2.5), fflush("some string") nor > fflush(a, b, c), you shouldn't fflush(stdin); the standard says that > "fflush()" is for output streams; not input streams, not strings, not > anything else; the non-standard way can work on a particular system, but it > can kill some lives on others. > > > > > what I need is a secure way to read as much as there is from stdin > > undtil '\n' into a char* buffer. I want that buffer to match the > > needed length (I don't know how to do that, since I don't know the > > exact needed length until i read it from stdin...) and I need to avoid > > buffer overflows (of course). > > I thought scanf() is a good way, since it reads only a specified > > number of characters right? (ok, this is just a workaround, I guess..) > > > Try fgets(), then sscanf(). > > > > I don't think this is a unique problem so there must be a known way to > > solve it, is there? > > > > > Suggestion (for all you C programmers): > > The comp.lang.c answers to frequently asked questions: > http://www.eskimo.com/~scs/C-faq/top.html > > > > > > > > Daniel K. O. > > > > > > > --__--__-- > > Message: 7 > From: "Daniel K. O." <dan...@ya...> > To: <dev...@li...> > Subject: RES: [Dev-C++] General question / remark > Date: Fri, 25 Apr 2003 19:03:26 -0300 > > > > > -----Mensagem original----- > > De: dev...@li... > > [mailto:dev...@li...]Em nome de David > > Matthews > > Enviada em: sexta-feira, 25 de abril de 2003 18:02 > > Para: Janos Blazi; dev...@li... > > Assunto: Re: [Dev-C++] General question / remark > > > > > > Well, gdb is already integrated with Dev-C++. It doesn't have the best > > interface, IMHO, so there's also the Insight frontend (available on > > www.bloodshed.com/dev/) Of course, it screws up the Dev-C++ 5 > > betas so you > > can't get rid of it. > > > > Just install Insight on another directory, and add it to your Tools menu. > Backing-up your original "gdb.exe" also helps if you want to install Insight > on Dev-C++'s directory. > > > > > > > Daniel K. O. > > > > > > --__--__-- > > Message: 8 > From: Colin Laplace <ha...@bl...> > Reply-To: ha...@bl... > To: dev...@li... > Date: Sat, 26 Apr 2003 01:13:53 +0200 > Subject: [Dev-C++] Kip Warner leaves the project > > Hello, > > Kip Warner, the author and maintener of vUpdate and vRoach tools, has decided > to leave the project. You can view his letter of resignation at : > http://www.zero47.com/html/literature/DevCppResignation.html > > I just wanted to let everybody know. Nothing has been decided yet about the > future of vUpdate, but in all case there will still be an update system for > Dev-C++. > > Greetings, > Colin Laplace > > > > --__--__-- > > Message: 9 > From: "Ioannis Vranos" <iv...@at...> > To: "Dev-C++ Mailing List" <dev...@li...> > Subject: RE: Re[2]: [Dev-C++] stdin reset... > Date: Sat, 26 Apr 2003 04:47:54 +0300 > > > -----Original Message----- > > From: Christian Sch=E4fer [mailto:ca...@kr...]=20 > > Sent: Friday, April 25, 2003 11:55 PM > > To: dev...@li...; Ioannis Vranos > > Cc: dev...@li... > > Subject: Re[2]: [Dev-C++] stdin reset... > >=20 > >=20 > > and why is that? > > I am very interested in code security issues but at least i want to > > understand instead of obey them. so what exactly is considered > > 'unsafe'? > >=20 > > what I need is a secure way to read as much as there is from stdin > > undtil '\n' into a char* buffer. I want that buffer to match the > > needed length (I don't know how to do that, since I don't know the > > exact needed length until i read it from stdin...) and I need to avoid > > buffer overflows (of course). > > I thought scanf() is a good way, since it reads only a specified > > number of characters right? (ok, this is just a workaround, I guess..) > >=20 > > I don't think this is a unique problem so there must be a known way to > > solve it, is there? > > > fflush() is intended for output streams, not input. For example > fflush(stdin); does not work in GNU/Linux. So you can't expect > fflush(stdin); to be portable. You will have to use aither a plain > getchar(); call after a plain scanf() or create a clean function in the > style: > > > void clean_stdin() > { > while(getchar()!=3D'\n') > ; > } > > > > > Ioannis Vranos > =20 > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > Anti-racism movement: http://www.positive-youthfoundation.org > Iraq Peace Pledge: http://www.peacepledge.org > > > > > > --__--__-- > > _______________________________________________ > 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 > > > End of Dev-cpp-users Digest |
|
From: <ca...@kr...> - 2003-04-26 07:27:27
|
hi Dev-C++,
[this is a followup thread to 'stdin reset..']
I want to programm a shell-like interface for my application, in which
I know some special commands with options and arguments.
the problem I have is, how do I create an input-buffer, that is able
to hold whatever is read from stdin, since i can not say what would be
the longest valid entry (say cat some large text...).
is there a way to dynamically read the length of the inputstring up to
the first '\n' and then malloc some string and THEN scanf() ???
gruss
/Christian mailto:ca...@kr...
---
I propose that the following character sequence for joke markers:
:-)
19-Sep-82 11:44 Scott E Fahlman
|
|
From: <ca...@kr...> - 2003-04-26 07:22:34
|
hi Ioannis,
> fflush() is intended for output streams, not input. For example
> fflush(stdin); does not work in GNU/Linux. So you can't expect
> fflush(stdin); to be portable. You will have to use aither a plain
> getchar(); call after a plain scanf() or create a clean function in the
> style:
> void clean_stdin()
> {
> while(getchar()!='\n')
> ;
> }
ok, I now understand why not to use fflush(). (I would have noticed
when porting to linux whats the final destination... ;)
so you mean, I scanf() whatever I need and then let getchar() go
through stdin again clearing everything until the first '\n', right?
ok then, that would solve the first halve of my problem.
for the second I open another thread. thanks a lot!
gruss
/Christian mailto:ca...@kr...
---
I propose that the following character sequence for joke markers:
:-)
19-Sep-82 11:44 Scott E Fahlman
|
|
From: Neszt T. <ne...@ss...> - 2003-04-26 07:03:06
|
Hello! > Yes knowing that you are using the hungarian keyboard is important (at least > I think it is!!!). > > So the semicolon works fine in all applications except in dev-c++ ? The only > thing I'd recommend is changing your settings in control panel to use a > different character set for your keyboard. I'm afraid I'm not sure what else > you could do. > > Oh hang on, have you tried typing ; in notepad or somewhere, and in Dev-C++ > doing a paste to put the semi colon in? What happens this way? Does the semi > colon appear, or do you get nothing, or some garbage character? Could be to > do with unicode/dbcs/ascii perhaps. Yes, the paste is works! Now that is the only way me to type ";" in devc. I can tell You, the same key, which I use to type ";" in all other applications, do nothing in the devc. I mean no character apperars, after pressing it. Ioannis Vranos: > Then you can add the English (American) keyboard langage with keyboard > layout US, and use it to write your code. Yes, as I said, I tried all of windows keyboard setting also. But here is a curious thing. When I start the devc, the key setting automatical switch to Hungarian. After that I can switch back manually to American, but the semicolon till not available. So, thanks for You to pay attention, and I'm waiting for You new solution tips. :) Regards, Neszt Tibor |
|
From: Ioannis V. <iv...@at...> - 2003-04-26 01:48:03
|
> -----Original Message-----
> From: Christian Sch=E4fer [mailto:ca...@kr...]=20
> Sent: Friday, April 25, 2003 11:55 PM
> To: dev...@li...; Ioannis Vranos
> Cc: dev...@li...
> Subject: Re[2]: [Dev-C++] stdin reset...
>=20
>=20
> and why is that?
> I am very interested in code security issues but at least i want to
> understand instead of obey them. so what exactly is considered
> 'unsafe'?
>=20
> what I need is a secure way to read as much as there is from stdin
> undtil '\n' into a char* buffer. I want that buffer to match the
> needed length (I don't know how to do that, since I don't know the
> exact needed length until i read it from stdin...) and I need to avoid
> buffer overflows (of course).
> I thought scanf() is a good way, since it reads only a specified
> number of characters right? (ok, this is just a workaround, I guess..)
>=20
> I don't think this is a unique problem so there must be a known way to
> solve it, is there?
fflush() is intended for output streams, not input. For example
fflush(stdin); does not work in GNU/Linux. So you can't expect
fflush(stdin); to be portable. You will have to use aither a plain
getchar(); call after a plain scanf() or create a clean function in the
style:
void clean_stdin()
{
while(getchar()!=3D'\n')
;
}
Ioannis Vranos
=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
Anti-racism movement: http://www.positive-youthfoundation.org
Iraq Peace Pledge: http://www.peacepledge.org
|
|
From: Colin L. <ha...@bl...> - 2003-04-25 23:33:35
|
Hello, Kip Warner, the author and maintener of vUpdate and vRoach tools, has decided to leave the project. You can view his letter of resignation at : http://www.zero47.com/html/literature/DevCppResignation.html I just wanted to let everybody know. Nothing has been decided yet about the future of vUpdate, but in all case there will still be an update system for Dev-C++. Greetings, Colin Laplace |
|
From: Daniel K. O. <dan...@ya...> - 2003-04-25 22:03:29
|
> -----Mensagem original----- > De: dev...@li... > [mailto:dev...@li...]Em nome de David > Matthews > Enviada em: sexta-feira, 25 de abril de 2003 18:02 > Para: Janos Blazi; dev...@li... > Assunto: Re: [Dev-C++] General question / remark > > > Well, gdb is already integrated with Dev-C++. It doesn't have the best > interface, IMHO, so there's also the Insight frontend (available on > www.bloodshed.com/dev/) Of course, it screws up the Dev-C++ 5 > betas so you > can't get rid of it. Just install Insight on another directory, and add it to your Tools menu. Backing-up your original "gdb.exe" also helps if you want to install Insight on Dev-C++'s directory. Daniel K. O. |
|
From: Daniel K. O. <dan...@ya...> - 2003-04-25 21:57:59
|
> >> fflush(stdin);
> > Which is not safe. getchar(), fgets(), etc, should be used instead,
>
> and why is that?
> I am very interested in code security issues but at least i want to
> understand instead of obey them. so what exactly is considered
> 'unsafe'?
The same reason you shouldn't fflush(2.5), fflush("some string") nor
fflush(a, b, c), you shouldn't fflush(stdin); the standard says that
"fflush()" is for output streams; not input streams, not strings, not
anything else; the non-standard way can work on a particular system, but it
can kill some lives on others.
> what I need is a secure way to read as much as there is from stdin
> undtil '\n' into a char* buffer. I want that buffer to match the
> needed length (I don't know how to do that, since I don't know the
> exact needed length until i read it from stdin...) and I need to avoid
> buffer overflows (of course).
> I thought scanf() is a good way, since it reads only a specified
> number of characters right? (ok, this is just a workaround, I guess..)
Try fgets(), then sscanf().
> I don't think this is a unique problem so there must be a known way to
> solve it, is there?
Suggestion (for all you C programmers):
The comp.lang.c answers to frequently asked questions:
http://www.eskimo.com/~scs/C-faq/top.html
Daniel K. O.
|
|
From: David M. <dem...@uw...> - 2003-04-25 21:34:19
|
Well, gdb is already integrated with Dev-C++. It doesn't have the best interface, IMHO, so there's also the Insight frontend (available on www.bloodshed.com/dev/) Of course, it screws up the Dev-C++ 5 betas so you can't get rid of it. At 04:55 PM 25/04/2003 +0200, Janos Blazi wrote: >After having played with Dec-C++ for a few days, here is what I see: >The IDE that Dev-C++ is so good that I should probably never use Emacs for >programming any more. It (Dev-C++) is so much better than MVC++6. > >So the only problem (as far as I and probably many other people are >concerned) is the lack of a decent debugger. I do not know how difficult it >is to write a MVC++6 style debugger but that debugger is excellent. >Now I just thought: The Watcom sources should be be free by now; so >wouldn't it be possible to look at that code and learn how they implemented >their debugger (which almost paralleled the MVC++ debugger) and write your >own debugger. Taken the genuine devotion of the Dev-C++ team (othwewise >they could not have created such a nice product) it would be only a >question of until they woul produce even a better debugger. > >Is this suggestion completely stupid? Is any work being done on a debugger >vor Dev-C++? > >(As for the quality of the compiler, for most applications it is not that >decisive.) > >At the moment I use Dev-C++ and for the tricky parts MVC++6. Anyway, thx >for this great product. > >-- >EG > > >------------------------------------------------------- >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 > |
|
From: <ca...@kr...> - 2003-04-25 20:54:09
|
hi Ioannis,
>> > -stdin gets cleared
>> > how can i do that?
>>
>> fflush(stdin);
> Which is not safe. getchar(), fgets(), etc, should be used instead,
and why is that?
I am very interested in code security issues but at least i want to
understand instead of obey them. so what exactly is considered
'unsafe'?
what I need is a secure way to read as much as there is from stdin
undtil '\n' into a char* buffer. I want that buffer to match the
needed length (I don't know how to do that, since I don't know the
exact needed length until i read it from stdin...) and I need to avoid
buffer overflows (of course).
I thought scanf() is a good way, since it reads only a specified
number of characters right? (ok, this is just a workaround, I guess..)
I don't think this is a unique problem so there must be a known way to
solve it, is there?
gruss
/Christian mailto:ca...@kr...
---
I propose that the following character sequence for joke markers:
:-)
19-Sep-82 11:44 Scott E Fahlman
|
|
From: Ioannis V. <iv...@at...> - 2003-04-25 20:36:15
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Neszt Tibor > Sent: Friday, April 25, 2003 4:23 PM > To: Daniel Glenfield > Cc: dev...@li... > Subject: Re: [Dev-C++] missing ";" > > > > ok let's find out a few things. If you open notepad or > another text editor > > can you type a semi colon? If you can, you'll need to > reinstall DEV. If not, > > you need to reinstall your OS or, if a special keyboard, > the keyboard > > driver. > > Reinstall OS :-))))) > > Oh, funny, You don't understand me. Of course, I can type > semicolon all of > my other programs. Need to reintall devc++? How many times? > If You read > my letter thoughtfully, You can see, I tried many version of devc++. > Moreover! In the meantime, I tried to install devc++ to 4 > other computers, > and the semicolor is missing on all of them. > I'm sure the problem is NOT in the devc++. > I use hungarian keyboard, if it is important. (Any other > hungarian user > here?) > > Regards, > > Neszt Tibor > > P.s.: To see, I can type semicolon here... ;;;;;;;;;;; Then you can add the English (American) keyboard langage with keyboard layout US, and use it to write your code. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: Ioannis V. <iv...@at...> - 2003-04-25 20:33:24
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Christian Sch=E4fer > Sent: Friday, April 25, 2003 3:30 PM > To: dev...@li... > Subject: Re: [Dev-C++] stdin reset... >=20 >=20 > > -stdin gets cleared > > how can i do that? >=20 > fflush(stdin); >=20 > just found out how.. thanks anyway! Which is not safe. getchar(), fgets(), etc, should be used instead, Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: Pierre R. <pie...@wa...> - 2003-04-25 20:26:14
|
"jp" <rar...@xt...> on Fri, 25 Apr 2003 07:27:16 +1200 wrote:
> Hi,
>=20
> This isn't a Dev-Cpp question, but I'd be interested in anyone's=20
> thoughts...
>=20
> If I'm using C++, I avoid using the preprocessor for anything except
> #include's and #pragma's.
>=20
> The directives I most despise are #line, as suffered by users of =
lex/yacc,
> esql, and other source code generators, and ...
>=20
> #ifdef ENTIRELY_STUPID_FEATURE_FOR_ANNOYING_CLIENT
> void stupid();
> #endif
>=20
> If I need a constant I use, eg, enum{SOMETHING=3D0xffffffff}; One of =
the
> benefits is that such constants are scoped. It bugs me when I want, =
eg,
> enum{ERROR=3D0xffffffff}; and ERROR has already been #defined in a =
header...
> Sometimes, wash my mouth out, I #undef, eg, ERROR..
>=20
> If I need a macro I use...
> template <typename someT> void xargle( someT& thing)
> {
> xargle_buffer << thing;
> }
>=20
> BUT, and here's the point of my question, I don't know of any way to
> stringize or token paste without using the preprocessor. I have=20
> a lisp. Not
> literally, like thith, but a library I've written. Built in types are
> instantiated using templates, so that, given a constant type id (eg:
> INTEGER), I can add a new type like so..
>=20
> DECLTYPE(int, INTEGER, Integer)
>=20
> the macro DECLTYPE looks like this...
>=20
> #define DECLTYPE(T, I, n)typedef imp::ImplObject<T, I> n;\
> bool is##n(const Object &obj);\
> const T &get##n(const Object &obj);\
> T &ref##n(const Object &obj);
>=20
> and there is an equally brief IMPLTYPE.
> The library allows constructions like..
>=20
> Object thing =3D String("gimme five: ");
> String s =3D thing;
> Integer i =3D 4;
> thing =3D i;
>=20
> refInteger(thing)++;
> cout << s << thing;
>=20
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> This all works pretty well, and my lisp handles multimedia, ISAM, COM,
> sockets and other exotica in a fully object oriented, but=20
> typesafe, manner.
> But FUNGLTYPE is a macro, and like I say, #define's are for grannies, =
so..
> ..does anybody know of an alternative to macros for generating =
identifiers
> from user supplied fragments?
>=20
> Cheers,
> jp.
I'm not sure to fully understand your need, but may be you can get some =
ideas here:
Chap. 3 "Typelists", Modern C++ Design, Andrei Alexandrescu, Addison =
Wesley ed.
or else:
http://www.cuj.com/experts/2002/alexandr.htm?topic=3Dexperts
http://www.research.ibm.com/designpatterns/pubs/ph-jun00.pdf
with the loki library here:
http://sourceforge.net/projects/loki-lib/
Regards
Pierre Raoul
|
|
From: philip M. <ph...@co...> - 2003-04-25 16:42:27
|
You could have written:
printf("prompt > ");
scanf("%4s", buffer);
while (fgetc(stdin) != '\n');
> I try the following code:
>
> <snip>
> #include <stdio.h>
>
> int main(int argc, char** argv)
> {
> char buffer[5];
> while(1)
> {
> printf("prompt > ");
> scanf("%4[^\n]",buffer);
>
> printf("you typed: %s\n", buffer);
> printf("you typed: %d %d %d %d %d\n", buffer[0], buffer[1],
buffer[2], buffer[3], buffer[4]);
> }
>
> return 0;
> }
> </snap>
--------------------------------------------------------------------------
Philip Mortimer
www: http://mysite.freeserve.com/coniferway/index.html.
Available for short and long term contracts
---------------------------------------------------------------------------
|