dev-cpp-users Mailing List for Dev-C++ (Page 542)
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...@ho...> - 2002-08-07 17:39:29
|
Well since i have never encountered any strange compiler behaviour in my life, can you provide us with an example source code that behaves "strangely"? I 'll be honest, i do not believe you discovered any compiler strange behaviour, just programming mistakes. =20 =20 =20 Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net <http://www.noicys.cjb.net/>=20 * Alternative URL: http://run.to/noicys =20 =20 From: dev...@li... [mailto:dev...@li...] On Behalf Of Carlos Garc=EDa del Monte Sent: Wednesday, August 07, 2002 6:42 PM To: dev-cpp-users-list Subject: Re:Re: [Dev-C++] iterating by 2 I always set C++ and save as cpp Can give problems doing as c++ but writting c (and saving as cpp)?=20 But I always use c++ and save as cpp, the only I do sometimes is using stdio for using FILE * instead of fstream (if binary files, yes, I know fstream can do, but...).=20 Well, I know in C++ you can declare variables when you need them, I do it many times, and that it's "supposed" that you can do for(int i[...], in fact the report of that error surprised me "hey, that's legal, why...?". But that's just the behaviour I find. |
|
From: <Met...@ao...> - 2002-08-07 17:00:44
|
mu...@gm... wrote : > Try muting your microphone in Volume Control. > I think this is a joke :-))) No, in fact, I guess that the beep sound comes like there was an error because my edit control is single lined. Pressing returns makes the system tells the user that he can't add more items in the edit box. Now I'm trying to get rid of the enter key keycode in the edit control buffer but I still don't know how. I think I will see this by tomorrow now... Time for dinner ! Kind regards -- Seb |
|
From: <h.r...@gm...> - 2002-08-07 16:54:37
|
> > i have a few questions as usual:)i copied some projects from deitel(the > book i use for learning c++) and i wrote the things i didn't understand > beside the phrases and i hope that any of you would read the files i send and > help me... > > thanx a lot.. > > senem > i cant find any code -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net |
|
From: Abhijit S. <mu...@gm...> - 2002-08-07 16:54:08
|
----- Original Message ----- From: Met...@ao... To: sp...@ho... ; dev...@li... Sent: Wednesday, August 07, 2002 8:37 PM Subject: Re: [Dev-C++] Sending API messages from *within* a subclassed control Thank you spurs. Didn't thought about this solution. Like each time, it was as simple as that. Anyway, I get a strange "ping" sound each time I press on return key. Side effect ? Kind regards -- Seb ---------------------------------- Try muting your microphone in Volume Control. ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |
|
From: senem b. <sbe...@ya...> - 2002-08-07 16:38:38
|
i have a few questions as usual:)i copied some projects from deitel(the book i use for learning c++) and i wrote the things i didn't understand beside the phrases and i hope that any of you would read the files i send and help me... thanx a lot.. senem --------------------------------- Do You Yahoo!? Yahoo! Health - Feel better, live better |
|
From: Jim W. <ma...@em...> - 2002-08-07 15:58:07
|
Thank you again. I have the 2nd edition of the book (1991) which does not cover namespaces, but recently purchased "Beginning Visual C++ 6" by Ivor Horton which is shaping up to be an excellent resource on both C++ and general Windows programming. Give me a few months and I'll not be such a C++ newbie. (:) <= encapsulated http://www.bookpool.com/.x/dcoe46d6b8/sm/186100088X Jim Watters -----Original Message----- From: Ioannis Vranos I recommend to read "The C++ Programming Language" 3rd Edition or Special Edition by Bjarne Stroustrup (the creator of C++) after you finish with your introductory book(s). It will be much pain to read it cover to cover, but this is the cost of becoming an expert. |
|
From: Carlos d. M. <cg...@wo...> - 2002-08-07 15:47:41
|
Ioannis Vranos escribi=F3:
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf Of Carlos
> Garc?a del Monte
> Sent: Tuesday, August 06, 2002 3:13 PM
> To: dev-cpp-users-list
> Subject: Re: [Dev-C++] iterating by 2
>
>
> It shall work if it compiles. But when I declare i like you,
> inside a for statement, the compiler reports error due to an
> old fashioned way to declare it, try to declare it before
> the for.
>
> ? What compiler do you have?
> I updated to mingw1.1 (I've Dev 4) Don't say it's older than
> the one with Dev 4!!!
>
>
> But then that error should have been reported.
>
> Or substitute it by a while, and perhaps after you can
> restore the for and see what happens.
> On one of my recent experiments I first used a for, the
> program didn't run and I changed it by a while, and it
> worked (???????), after I used again the for and it worked
> (??????????!!!!!!!!!!!!!!). Obviously the first time you
> made a syntax error. The definition inside a for loop is
> valid ANSI C++ (we are talking about C++ here).
> The program compiled without error nor warnings. No errors,
> I am absolutely sure. I only changed for(counter =3D 0;
> condition; counter++){[...]}
> by counter =3D 0; while(condition);[... counter++];}, and
> back to for[..]. If syntax errors I should have change
> something more, but no more changes than the absolutely
> needed by the fact of changing for by while.
>
> Some times the compiler behaves a little strange, it pass
> over lines don't executing them, or calls functions which
> are not called where it calls them, or makes a for or while
> not work although it is well written..
> Your compiler needs psychiatric evaluation. :)
>
> Or an axe!
>
> Be carfull of file extension like :
> a.c and a.cpp
> if in a i have
> for (int i=3D0;i<19;i++)
> {
> };
> if you save like a.c you are candidate for an error depends
> if the
> compiler takes or not .c file like .cpp
> but if you save like a.cpp your compiler always take this
> statement like
> cpp
>
> I always set C++ and save as cpp Can give problems doing as
> c++ but writting c (and saving as cpp)?
> But I always use c++ and save as cpp, the only I do
> sometimes is using stdio for using FILE * instead of fstream
> (if binary files, yes, I know fstream can do, but...).
>
> Well, I know in C++ you can declare variables when you need
> them, I do it many times, and that it's "supposed" that you
> can do for(int i[...], in fact the report of that error
> surprised me "hey, that's legal, why...?". But that's just
> the behaviour I find.
>
|
|
From: Ioannis V. <no...@ho...> - 2002-08-07 15:31:46
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Jim Watters > Sent: Wednesday, August 07, 2002 5:53 PM > To: dev...@li... > Subject: RE: [Dev-C++] Stupid question > > > > Argh! :) can be overloaded? > > Exactly, the books I'm studying from are old, but I have seen > references > to omitting the header extension and using namespaces in > (ANSI/ISO) C++. Well i happened to start learning C++ with an outdated book too. I recommend to read "The C++ Programming Language" 3rd Edition or Special Edition by Bjarne Stroustrup (the creator of C++) after you finish with your introductory book(s). It will be much pain to read it cover to cover, but this is the cost of becoming an expert. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys |
|
From: <Met...@ao...> - 2002-08-07 15:07:44
|
Thank you spurs. Didn't thought about this solution. Like each time, it was as simple as that. Anyway, I get a strange "ping" sound each time I press on return key. Side effect ? Kind regards -- Seb |
|
From: Jim W. <ma...@em...> - 2002-08-07 14:53:02
|
Argh! :) can be overloaded? Exactly, the books I'm studying from are old, but I have seen references to omitting the header extension and using namespaces in (ANSI/ISO) C++. :)) Jim -----Original Message----- From: Ioannis Vranos > You mean :) must be used instead of ;-)? Something like that. :)) > Thanks. I'm used to C and doing things "the old way". You mean to C and pre-ANSI C++ (because C has nothing to do with that).. |
|
From: Daniel G. <sp...@ho...> - 2002-08-07 14:50:21
|
What about PostMessage ? BOOL PostMessage( HWND hWnd, // handle to destination window UINT Msg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ); >From: Met...@ao... >To: dev...@li... >Subject: [Dev-C++] Sending API messages from *within* a subclassed control >Date: Wed, 7 Aug 2002 10:17:30 EDT > >Hi there. > >I subclassed a single line edit box in a dialog window, to verify user >entry. >The subclassing works very well, I am able to see WM_KEYDOWN-like messages. > >But now, as the user press "enter", I just want to send a message to the >dialog box, like the user has clicked on the "Go" button, just beside the >edit box. > >I tried setting the msg var to WM_COMMAND, the wParam var to id of the >button >and let the CallWindowProc at the end of the subclassed message handling >proc >do the work but nothing happens. > >I've tried to find some examples on google groups and the web but nothing >really helps. > >If anybody had a relevant piece of code to do this, it would be nice for >me. > >Thanks all mates > >-- > >Seb _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com |
|
From: Ioannis V. <no...@ho...> - 2002-08-07 14:37:32
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Jim Watters > Sent: Wednesday, August 07, 2002 4:11 PM > To: dev...@li... > Subject: RE: [Dev-C++] Stupid question > > > -----Original Message----- > From: Jim Watters > > #include <iostream.h> > > ;-) > > -----Original Message----- > From: Ioannis Vranos > > #include <iostream> > > using namespace std; > > :) > > -----New Message----- > > You mean :) must be used instead of ;-)? Something like that. :)) > Thanks. I'm used to C and doing things "the old way". You mean to C and pre-ANSI C++ (because C has nothing to do with that).. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys |
|
From: <Met...@ao...> - 2002-08-07 14:17:41
|
Hi there. I subclassed a single line edit box in a dialog window, to verify user entry. The subclassing works very well, I am able to see WM_KEYDOWN-like messages. But now, as the user press "enter", I just want to send a message to the dialog box, like the user has clicked on the "Go" button, just beside the edit box. I tried setting the msg var to WM_COMMAND, the wParam var to id of the button and let the CallWindowProc at the end of the subclassed message handling proc do the work but nothing happens. I've tried to find some examples on google groups and the web but nothing really helps. If anybody had a relevant piece of code to do this, it would be nice for me. Thanks all mates -- Seb |
|
From: Jim W. <ma...@em...> - 2002-08-07 13:11:36
|
-----Original Message----- From: Jim Watters #include <iostream.h> ;-) -----Original Message----- From: Ioannis Vranos #include <iostream> using namespace std; :) -----New Message----- You mean :) must be used instead of ;-)? Thanks. I'm used to C and doing things "the old way". :) Jim |
|
From: <dan...@ya...> - 2002-08-07 12:54:01
|
--- Hongli Lai <h....@ch...> escreveu: > On Wed, 2002-08-07 at 10:17, Mathias Luxner wrote: > > sometimes a window pops up in devc++ and says > "list out of bounds (###)" > > what does this message mean? > > > > It's a bug in the IDE. > > But we can't fix it unless we can reproduce it... For me it always happens when I put both mouse and keyboard cursors over a function or variable identifier; I have to turn off the parser. Daniel K. O. _______________________________________________________________________ Yahoo! PageBuilder O super editor para criação de sites: é grátis, fácil e rápido. http://br.geocities.yahoo.com/v/pb.html |
|
From: Hongli L. <h....@ch...> - 2002-08-07 09:18:15
|
On Wed, 2002-08-07 at 10:17, Mathias Luxner wrote: > sometimes a window pops up in devc++ and says "list out of bounds (###)" > what does this message mean? > It's a bug in the IDE. But we can't fix it unless we can reproduce it... |
|
From: Mathias L. <ma...@lu...> - 2002-08-07 08:17:10
|
sometimes a window pops up in devc++ and says "list out of bounds (###)" what does this message mean? thx mat |
|
From: Ioannis V. <no...@ho...> - 2002-08-07 08:12:08
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Teodorescu Cristian > Sent: Wednesday, August 07, 2002 10:24 AM > To: Dev-C++ Mailing List > Subject: Re: [Dev-C++] iterating by 2 > > > Ioannis Vranos wrote: > > >Actually, only with the exception that you use some specific compiler > >treatment switch, a .c file is considered as a C source code > and .cpp as > >C++ source code. > > > > > >C & C++ are *different* languages. > > > > > >In ANSI C++ 1998 standard the definition inside a for loop > is legal (and > >recommended). In general you can define variables where you > first need > >them. > > > > > >In ANSI C 1990 standard you can only define variables at the > beginning > >of a scope only. > > > >In ANSI C 1999 standard you can define variables as in C++, but the > >language is messy. > > > > > >Anyway when you code in C++ always use .cpp file. > > > > > yes i do you do but not everyone and most of them use c++ > features and > write procedural code and they say that that code is write in c > so they save with .c so ... Even if when you write procedural code C and C++ have differences, especially C99 and C++98. > some compilers do mistacke like > borland 3.1 Borland 3.1 is very old. I am talking about post ANSI C++ 1998 standard era. That is for nowadays compilers. > try this in a .c file > int dummy (int & a ) my collegs do and by default the file name is > noname00.cpp compile run ok. > After save in a.c compile error "not ok " and they stay about > 10 min to > figure out until theacher said that they had to rename the file Yes. That's what i am talking about. C and C++ are different. Save C code in .c files and C++ code in .cpp files. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys |
|
From: Teodorescu C. <te...@xt...> - 2002-08-07 07:22:10
|
Ioannis Vranos wrote:
>>-----Original Message-----
>>From: dev...@li...=20
>>[mailto:dev...@li...] On Behalf=20
>>Of Teodorescu Cristian
>>Sent: Wednesday, August 07, 2002 8:29 AM
>>Cc: dev-cpp-users-list
>>Subject: Re: [Dev-C++] iterating by 2
>>
>>
>>Carlos Garc=EDa del Monte wrote:
>>
>> =20
>>
>>>It shall work if it compiles. But when I declare /i /like=20
>>> =20
>>>
>>you, inside=20
>> =20
>>
>>>a for statement, the compiler reports error due to an old fashioned=20
>>>way to declare it, try to declare it before the for. But then that=20
>>>error should have been reported.
>>> =20
>>>
>>Be carfull of file extension like :
>>a.c and a.cpp
>>if in a i have
>>for (int i=3D0;i<19;i++)
>>{
>>};
>>if you save like a.c you are candidate for an error depends if the=20
>>compiler takes or not .c file like .cpp
>>but if you save like a.cpp your compiler always take this=20
>>statement like=20
>>cpp
>> =20
>>
>
>Actually, only with the exception that you use some specific compiler
>treatment switch, a .c file is considered as a C source code and .cpp as
>C++ source code.
>
>
>C & C++ are *different* languages.
>
>
>In ANSI C++ 1998 standard the definition inside a for loop is legal (and
>recommended). In general you can define variables where you first need
>them.
>
>
>In ANSI C 1990 standard you can only define variables at the beginning
>of a scope only.=20
>
>In ANSI C 1999 standard you can define variables as in C++, but the
>language is messy.
>
>
>Anyway when you code in C++ always use .cpp file.
> =20
>
yes i do you do but not everyone and most of them use c++ features and=20
write procedural code and they say that that code is write in c
so they save with .c so ... some compilers do mistacke like borland 3.1=20
try this in a .c file
int dummy (int & a ) my collegs do and by default the file name is=20
noname00.cpp compile run ok.
After save in a.c compile error "not ok " and they stay about 10 min to=20
figure out until theacher said that they had to rename the file
>
>Concerning C, most compilers support (at least by default) C90.
>
>
>Ioannis
>
>* Ioannis Vranos
>* Programming pages: http://www.noicys.cjb.net
>* Alternative URL: http://run.to/noicys
>
>
>-------------------------------------------------------
>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
> =20
>
|
|
From: Raghunath Marella.S <ms...@ya...> - 2002-08-07 07:09:42
|
It looks like the declaration of a class function is required in .DEF file. But I am not getting what format will be the one to list a class member function in .DEF file. Will anyone suggest me the same. thanks & regards, Raghunath --- Per Westermark <pw...@ia...> wrote: > The normal way to create new classs in a DLL is to: > > - declare a (possibly abstract) base class in main > program. > - declare a new class inherriting from the base > class in the DLL. > - export a object-create function in the DLL. > > The main program then calls the create function in > the DLL, and receives a > pointer to the new subclassed object. > > Since virtual method calls are decided at run-time, > all virtual calls will > go to the new class implementation. Inline and > non-virtual methods will > use tme methods available at compile time, i.e. the > code in the main > program. > > /PWM > > > On Tue, 6 Aug 2002, Raghunath Marella.S wrote: > > > Hi there, > > > > I am trying to export a class in a DLL. I have > > declared that class as __declspec(dllexport). I am > > trying to link this DLL dynamicall from an > executable. > > With the help of a example in MSDN, i declared a > > similar class in executable, with same name and > also > > the same funcitons which are required to call from > > executable. This class in 'exe' was declared > > __declspec(dllimport). > > > > NOw a object for this class has been declared in > 'exe' > > and calling member functions thro object. > > > > The DLL was loaded by LoadLibrary(..) call. > > > > WIll any one let me know is the above procedure > > sufficient or something else also to be done. > > > > thanks & regards, > > Raghunath > > > > __________________________________________________ > > Do You Yahoo!? > > Yahoo! Health - Feel better, live better > > http://health.yahoo.com > > > > > > > ------------------------------------------------------- > > 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 > > > __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com |
|
From: Ioannis V. <no...@ho...> - 2002-08-07 06:35:52
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of Teodorescu Cristian
> Sent: Wednesday, August 07, 2002 8:29 AM
> Cc: dev-cpp-users-list
> Subject: Re: [Dev-C++] iterating by 2
>=20
>=20
> Carlos Garc=EDa del Monte wrote:
>=20
> > It shall work if it compiles. But when I declare /i /like=20
> you, inside=20
> > a for statement, the compiler reports error due to an old fashioned=20
> > way to declare it, try to declare it before the for. But then that=20
> > error should have been reported.
>=20
> Be carfull of file extension like :
> a.c and a.cpp
> if in a i have
> for (int i=3D0;i<19;i++)
> {
> };
> if you save like a.c you are candidate for an error depends if the=20
> compiler takes or not .c file like .cpp
> but if you save like a.cpp your compiler always take this=20
> statement like=20
> cpp
Actually, only with the exception that you use some specific compiler
treatment switch, a .c file is considered as a C source code and .cpp as
C++ source code.
C & C++ are *different* languages.
In ANSI C++ 1998 standard the definition inside a for loop is legal (and
recommended). In general you can define variables where you first need
them.
In ANSI C 1990 standard you can only define variables at the beginning
of a scope only.=20
In ANSI C 1999 standard you can define variables as in C++, but the
language is messy.
Anyway when you code in C++ always use .cpp file.
Concerning C, most compilers support (at least by default) C90.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|
|
From: Ioannis V. <no...@ho...> - 2002-08-07 06:13:32
|
<http://run.to/noicys> -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Jim Watters Sent: Wednesday, August 07, 2002 12:42 AM To: dev...@li... Subject: RE: [Dev-C++] Stupid question #include <iostream.h> ;-) #include <iostream> // ... using namespace std; :) Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net <http://www.noicys.cjb.net/> * Alternative URL: http://run.to/noicys |
|
From: Teodorescu C. <te...@xt...> - 2002-08-07 05:27:57
|
Carlos Garc=EDa del Monte wrote:
> It shall work if it compiles. But when I declare /i /like you, inside=20
> a for statement, the compiler reports error due to an old fashioned=20
> way to declare it, try to declare it before the for. But then that=20
> error should have been reported.
Be carfull of file extension like :
a.c and a.cpp
if in a i have
for (int i=3D0;i<19;i++)
{
};
if you save like a.c you are candidate for an error depends if the=20
compiler takes or not .c file like .cpp
but if you save like a.cpp your compiler always take this statement like=20
cpp
> Or substitute it by a while, and perhaps after you can restore the for=20
> and see what happens.
> On one of my recent experiments I first used a for, the program didn't=20
> run and I changed it by a while, and it worked (???????), after I used=20
> again the for and it worked (??????????!!!!!!!!!!!!!!).
> Some times the compiler behaves a little strange, it pass over lines=20
> don't executing them, or calls functions which are not called where it=20
> calls them, or makes a for or while not work although it is well=20
> written...
>
> tam...@ms... escribi=F3:
>
>> I have been tasked with a problem in my newbie manual to use a "for=20
>> loop" and to console out by 2's from 0 to 20 here's what I have done=20
>> and I was wondering 1st why it doesn't work and 2nd how do I make it=20
>> work. #include <iostream>int main()
>> {
>> // --- iterate an integer by 2
>> for (int i =3D 0; i <=3D 20; i+=3D2){
>> std::cout << i << '\n';
>>
>> }
>> // --- pause system
>> char end[5];
>> std::cin >> end; return 0;
>> } Thanks in advanceDanny
>> =20
>>
|
|
From: Jim W. <ma...@em...> - 2002-08-06 21:42:02
|
#include <iostream.h> ;-) -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of jansb000 Sent: Tuesday, August 06, 2002 5:25 PM To: Dev-C++ Subject: [Dev-C++] Stupid question I feel a bit silly but somehow I seem to have forgotten a basic setting in DEVC++. When I create a new project, using the templates for a console application, I can compile and run without any problem. (Note: the template contains the most simple main() with no functionality except waiting for a keypress). Next when I add one line to main(): cout << "Hello world\n"; then compiling is ok but linking doesn't work anymore. I get the message: [linker error] undefined reference to 'cout' Is there a library that I have to include? How does this work? |
|
From: jansb000 <jan...@pl...> - 2002-08-06 21:24:59
|
I feel a bit silly but somehow I seem to have forgotten a basic setting = in DEVC++. When I create a new project, using the templates for a console = application, I can compile and run without any problem. (Note: the = template contains the most simple main() with no functionality except = waiting for a keypress). Next when I add one line to main(): cout << "Hello world\n"; then compiling is ok but linking doesn't work anymore. I get the = message: [linker error] undefined reference to 'cout' Is there a library that I have to include? How does this work? |