Thread: Re: [Dev-C++] (no subject) (Page 2)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <h.r...@gm...> - 2002-03-05 21:19:07
|
Hi list, sometimes I doesnt understand the discussion, sorry. If I want to learn C++ then I learn C++. Why should it make sense to learn a other language first ? Nobody else would teach his child french, german or anything other if he want to teach them english only since it is easyer to learn that. greetings horst -- -------------------------- Horst Rößner Postf. 1802 52205 Stolberg 02402 / 6178 0171 6455636 GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net |
|
From: Jason H. <jas...@bt...> - 2002-03-05 22:29:30
|
MessageThe original question was: "Pre-high schooler needs information = on how to start learning programming". Learning how to program and = learning a specific language are actualy pretty seperate issues. If fact = you can learn the diciplines of programming without learning the = language at all. Carrying over from the spoken language analogy it's not a matter of = learning english, french or german, but leaning a common grammar (wrong = word?) which can be used between them. A way of structuring the words of = a language to give a particular meaning in a consistent manner. Maybe = it's a bad analogy. The whole idea of learning a way to program is to give you a way of = breaking down a problem to be solved and implementing it in a manner = that is less prone to coding faults. The more complex a system you = design the more time you need to spend on analysis and design and the = less on actualy writing code. I believe it's better to get into good = habits, before forming bad ones. :) Jason. ----- Original Message -----=20 From: h.r...@gm...=20 To: Dev...@li...=20 Sent: Tuesday, March 05, 2002 9:18 PM Subject: Re: [Dev-C++] (no subject) Hi list, sometimes I doesnt understand the discussion, sorry. If I want to learn C++ then I learn C++. Why should it make sense to = learn a other language first ?=20 Nobody else would teach his child french, german or anything other if = he want to teach them english only since it is easyer to learn that. greetings=20 horst=20 --=20 -------------------------- Horst R=F6=DFner Postf. 1802 52205 Stolberg 02402 / 6178 0171 6455636 GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net -------------------------------------------------------------------------= ----- As you said "C++ provides all the paradigms and facilities both high = level and low level,..." which I think is actualy a reason for not = learning C++ straight off. Also is the fact that C++ is a hybrid = language in that it can operate as both a structured language and an OOP = language, or a bit of both. When learning an approach it's important = that the learner is not confused by the features of a language, and is = kept on a 'tight leash' so to say. Another thing that C and C++ does is to expose pointers and references = more than most languages, as it is a middle level language. It would be = better to start with high level language which doesn't confuse complete = newbies with such things. I think pointers are one of the harder = concepts that most learning programmers have to get thier heads around = at some point, but not right at the beginning. As for C++ being the *best* language, it's a matter of point of view, = but I wouldn't say that any language is the best, much the same that any = spoken language is the best. When approaching a development you choose = the one that is right at the time. An additional benefit of learning = Pascal (or some other language) is that you can write on your CV = (Resume) that you can program in Pascal (or whatever). I believe that = Cobol programmers are very much in demand these days. Jason. ----- Original Message -----=20 From: Ioannis Vranos=20 To: Dev-C++=20 Sent: Tuesday, March 05, 2002 3:02 PM Subject: RE: [Dev-C++] (no subject) "Learn some easy language", "learn some outdated language", "so as = to get the fundamentals". Sorry guys i strongly disagree with you. My = advice is: Learn the *best* language directly. I started from C = straight, and now i am at C++ and i can suggest to learrn C at all and = go straight at C++. C++ provides all the paradigms and facilities both = high level and low level, so as anyone can learn as much as he wants and = start programming. There is no need to know the whole C++ so as to write = good programs. Also for a newcomer it is very easy to program in C++! Consider the code: #include <iostream> #include <string> int main() { using namespace std; string a=3D"This is my first program."; string b=3D"I wish to become a very good programmer"; string c=3Da+" "+b; cout<<c; } I also suggested a great book which permits to learn C++ rapidly. = "Accelerated C++" by Andrew Koenig, Barbara Moo. I was informed of this = book by BS himself in an email discussion we had on TC++PL. Then i = checked at Amazon and i saw it has good comments. Also i read the = contents and i think they are great too. Then i read the author's page = for the book and i liked it too. In summary a great book. http://www.research.att.com/~ark/bibliography/accelerated.html Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... = [mailto:dev...@li...] On Behalf Of Benjamin = Wheeless Sent: Tuesday, March 05, 2002 2:59 PM To: nic...@ya...; dev...@li... Subject: Re: [Dev-C++] (no subject) Good morning, Just wanted to chime in here. Jason's opinion on this topic is = right along the same lines as mine. I totally agree that it is = important to learn the fundamentals behind the structure of programming = first. As I mentioned in an email to another person posting this same = question (possibly the same person under a different email address)... = I'd recommend something like Pascal or QBasic to start you off. They = are outdated and are aimed at teaching programming from a console (DOS = window) environment, but they will be excellent at "starting your = journey" as Jason said, into the world of programming. Back when I was in college, the first programming language that = they taught there was Pascal. Then we progressed into C and C++ and = then into learning more about Data Structures, Algorithms, Operating = Systems, etc. Anyway, my point is...start with something small and work = up... QBasic, BASIC, and Pascal are all languages that are great = starting points. Start there, with the basics....and feel free to email should you = have any questions along the way. Benjamin Wheeless Network Systems - Delta Airlines, Inc. Atlanta, GA - USA 30320 = =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 ----Original Message Follows----=20 From: Nicole Mark=20 To: dev...@li...=20 Subject: [Dev-C++] (no subject)=20 Date: Mon, 4 Mar 2002 16:01:56 -0800 (PST)=20 Pre-high schooler needs information on how to start learning = programming=20 Thanks=20 ---------------------------------=20 Do You Yahoo!?=20 Yahoo! Sports - Sign up for Fantasy Baseball=20 -------------------------------------------------------------------------= - Send and receive Hotmail on your mobile device: Click Here _______________________________________________ Dev-cpp-users = mailing list Dev...@li... = https://lists.sourceforge.net/lists/listinfo/dev-cpp-users=20 |
|
From: Ioannis V. <no...@ya...> - 2002-03-06 00:09:40
|
-----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of h.r...@gm... Sent: Tuesday, March 05, 2002 11:19 PM To: Dev...@li... Subject: Re: [Dev-C++] (no subject) As you said "C++ provides all the paradigms and facilities both high level and low level,..." which I think is actualy a reason for not learning C++ straight off. Also is the fact that C++ is a hybrid language in that it can operate as both a structured language and an OOP language, or a bit of both. When learning an approach it's important that the learner is not confused by the features of a language, and is kept on a 'tight leash' so to say. =20 Another thing that C and C++ does is to expose pointers and references more than most languages, as it is a middle level language. It would be better to start with high level language which doesn't confuse complete newbies with such things. I think pointers are one of the harder concepts that most learning programmers have to get thier heads around at some point, but not right at the beginning. =20 =20 In C++ there is no need to use pointers or references. For simple tasks you can use the provided facilities without bothering for low level stuff: vectors, strings, cin, cout, e.t.c.. If you need to use pointers then you are dealing with advanced concepts not being able to implement them with a simpler language anyway. Also there is no need to learn C! =20 =20 =20 As for C++ being the *best* language, it's a matter of point of view, but I wouldn't say that any language is the best, much the same that any spoken language is the best. When approaching a development you choose the one that is right at the time. An additional benefit of learning Pascal (or some other language) is that you can write on your CV (Resume) that you can program in Pascal (or whatever). I believe that Cobol programmers are very much in demand these days. =20 =20 Knowing C i bought a Pascal book and learned it in 2 days. And this because C's abilities are a superset of Pascal abilities (after all the most Pascal compilers are written in C). After finishing with C++ i think i can learn any programming language of any of C++'s supported paradigms in the same time frame. =20 =20 C++ is not the "best language". It is the "best general purpose programming language". Or if you do not like this, it is the dominant general purpose programming language. :) According to IDC, in 2001 the 1st in use programming language was C++ & C (mainly C++), 2nd was Visual Basic and then the others. =20 I do not underestimate the other languages and their followers but i am just saying the facts. After all if C++ wasn't the best i would not study it in the first place. I wasn't forced to learn C++, i chose to learn it after checking the facts. =20 =20 =20 Ioannis =20 * 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...@ho...> - 2002-06-11 11:03:50
|
http://www.allegro.cc I have links to other libraries at http://www.noicys.cjb.net/links.htm It is not a self-advertisement, simply i have all my favorite links there. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys > -----Original Message----- > From: prasad athreya [mailto:pra...@ho...] > Sent: Tuesday, June 11, 2002 1:55 PM > To: no...@ho... > Subject: RE: [Dev-C++] (no subject) > > > thanks a lot > btw where do u get allegro from? > > > >From: "Ioannis Vranos" <no...@ho...> > >To: "Dev-C++ Mailing List" <dev...@li...> > >Subject: RE: [Dev-C++] (no subject) > >Date: Tue, 11 Jun 2002 13:44:16 +0300 > > > > > -----Original Message----- > > > From: dev...@li... > > > [mailto:dev...@li...] On Behalf > > > Of prasad athreya > > > Sent: Tuesday, June 11, 2002 1:31 PM > > > To: dev...@li... > > > Subject: [Dev-C++] (no subject) > > > > > > > > > hello > > > im trying to improve my program by colouring the text. Im not > > > sure how > > > exactly in devcpp to do this. > > > > > >You can use some 3rd party library, like Allegro. > > > > > > > I am also trying to find out whther it is possible to > print via a USB > > > printer port > > > > > >Of course it is, you will use some system extension, e.g > some Win32 API > >call which comes with Dev-C++. I do not know the particular call > >however. > > > > > >Ioannis > > > >* Ioannis Vranos > >* Programming pages: http://www.noicys.cjb.net > >* Alternative URL: http://run.to/noicys > > > >_______________________________________________________________ > > > >Don't miss the 2002 Sprint PCS Application Developer's Conference > >August 25-28 in Las Vegas - > http://devcon.sprintpcs.com/adp/index.cfm?> source=osdntextlink > > > > > >_______________________________________________ > >Dev-cpp-users mailing list > >Dev...@li... > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > |
|
From: Daniel G. <sp...@ho...> - 2002-07-01 09:44:13
|
No content either lol >From: "I Ketut Nurasa" <ke...@an...> >Reply-To: "I Ketut Nurasa" <ke...@an...> >To: <dev...@li...> >Subject: [Dev-C++] (no subject) >Date: Mon, 1 Jul 2002 15:55:46 +0700 > > _________________________________________________________________ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com |
|
From: Daniel G. <sp...@ho...> - 2002-07-13 17:44:44
|
Yes, your program runs correctly and has closed (because it has finished).
I always put
int Input;
cin >> Input;
before the return command.
That will work fine, as the window will stay open b/c the program will
finish once the user types a number and hits return.
P.S. Someone will come along and tell you to use SYSTEM("PAUSE") but don't
listen to them - the Glenfield standard defines this as the most _wicked way
of doing your thing ;)
>From: shankar <nis...@ya...>
>To: ha...@bl..., dev...@li...
>Subject: [Dev-C++] (no subject)
>Date: Sat, 13 Jul 2002 09:47:14 -0700 (PDT)
>
>
>Hi guys,
>
>You have created a wonderful programe. Thanks!!
>
> But, I tried to run this programme, the compile was succces but, when i
>tried to run, it just popup and gone.what is the problem.please help.
>
>p.s: i have downloaded all the patches from the web site.
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>#include <iostream.h>
>
>void main()
>{ void heading () ; //define functions
> void question_my ();
>
> heading (); //start programe
> question_my ();
>} //end main function
>
>//*******************************************************
>
>void heading ()
>{
> cout << "PGCC FORD DEALERSHIP WEEKLY INVENTORY \n" ;
> cout << "SALESPERSON : Shankar Siva \n" ;
>} //end of heading function
>//*******************************************************
>
>void question_my()
>{
> cout <<"Please Enter Model Sold:\n" ;
> cout <<"Please Enter Sticker Price:\n" ;
> cout <<"Please Enter what the Customer Paid:\n" ;
>
>
>}
>
>
>
>Have a nice day,
>
>SHANKAR
>
>
>
>
>
>
>
>---------------------------------
>Do You Yahoo!?
>Yahoo! Autos - Get free new car price quotes
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
|
|
From: Reid T. <Rei...@at...> - 2002-09-06 15:04:32
|
go here http://www.bloodshed.net/dev/ <http://www.bloodshed.net/dev/> click on the DOCUMENTATION link -----Original Message----- From: Ronny Vos [mailto:fa2...@sk...] Sent: Friday, September 06, 2002 10:33 AM To: dev...@li... Subject: [Dev-C++] (no subject) Hello,=20 I'm a teacher. I downloaded the Dev-c++ but I don't know how to use it pls can you tell me how to go about compiling and running programs right from opening the environment (Dev-C++). I don't know how to use it at all. =20 Where can I find information to use the compiler; =20 Ronny |
|
From: Robson B. <rob...@su...> - 2003-03-04 23:32:05
|
#include <stdlib.h>
use - system("PAUSE"); - at the end of main function
|
|
From: Daniel G. <sp...@ho...> - 2003-04-22 12:00:35
|
no body either... >From: Eric <eri...@cl...> >To: dev...@li... >Subject: [Dev-C++] (no subject) >Date: Tue, 22 Apr 2003 23:50:57 +1200 > > > > >--- >Outgoing mail is certified Virus Free. >Checked by AVG anti-virus system (http://www.grisoft.com). >Version: 6.0.474 / Virus Database: 272 - Release Date: 4/18/03 > > >------------------------------------------------------- >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 _________________________________________________________________ Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger |
|
From: Daniel G. <sp...@ho...> - 2003-05-25 09:49:34
|
Have you opened the file and had a look? You may want to download the latest version from the web - try a search on google perhaps? >From: "Tassos Tzavellas" <atz...@at...> >Reply-To: "Tassos Tzavellas" <el...@ma...> >To: <dev...@li...> >Subject: [Dev-C++] (no subject) >Date: Sun, 25 May 2003 12:06:47 +0300 > >Whenever I include stdio.h(#include <stdio.h>) I get a compiler message >that there is an syntax error in 2 line of stdio.h. > >line 221: "extern inline int vsnprintf (char* s, size_t n, const char* >format," >line 375: "extern inline int vsnwprintf (wchar_t* s, size_t n, const >wchar_t* format," >My programs still run even though I never include that library but one day >they might not.What can I do to fix that problem? _________________________________________________________________ Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile |
|
From: Per W. <pw...@ia...> - 2003-05-25 11:06:36
|
You mention a syntax error in line 2 of stdio.h. Then you display a couple of lines a long way later - line 221 and line 375. What do you mean? Anyway, the most common reason to get a compiler error at a very early line number of a a include file is that you have an error in a previous include file - such as a missing seimicolon at the end of a declaration. When the compiler then finds the first statement of the next include file, it will detect the missing semicolon and complain. /Per W On Sun, 25 May 2003, Daniel Glenfield wrote: > Have you opened the file and had a look? > You may want to download the latest version from the web - try a search on > google perhaps? > > > >From: "Tassos Tzavellas" <atz...@at...> > >Reply-To: "Tassos Tzavellas" <el...@ma...> > >To: <dev...@li...> > >Subject: [Dev-C++] (no subject) > >Date: Sun, 25 May 2003 12:06:47 +0300 > > > >Whenever I include stdio.h(#include <stdio.h>) I get a compiler message > >that there is an syntax error in 2 line of stdio.h. > > > >line 221: "extern inline int vsnprintf (char* s, size_t n, const char* > >format," > >line 375: "extern inline int vsnwprintf (wchar_t* s, size_t n, const > >wchar_t* format," > >My programs still run even though I never include that library but one day > >they might not.What can I do to fix that problem? > > _________________________________________________________________ > Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ObjectStore. > If flattening out C++ or Java code to make your application fit in a > relational database is painful, don't do it! Check out ObjectStore. > Now part of Progress Software. http://www.objectstore.net/sourceforge > _______________________________________________ > 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-07-03 12:33:08
|
I don't know much about sprintf, but maybe it it trying to write the value
of n into your 3d% bit ?
Try putting the \n command in another printf statement - this should give
the same effect.
Daniel
>From: "Jorge Abramian" <jab...@ma...>
>Reply-To: <jab...@ma...>
>To: <dev...@li...>
>Subject: [Dev-C++] (no subject)
>Date: Thu, 3 Jul 2003 07:02:26 -0400
>
>Hi,
>
>I wrote this piece of code willing that the numbers be written in different
>lines. However, the linefeed does not work. Any hint?
>
>///
>...
>#define <stdio.h>
>...
> hFile = CreateFile(szFileName, GENERIC_WRITE, 0, 0,
> CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
>
> for (loop=0;loop<Number_of_Points;loop++)
> {
> DWORD dWritten;
> sprintf (temp,"%3d\n\r",ran1[loop]);
> WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
> }
>
>/////
>Thanks a lot
>
>JEA
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>Data Reports, E-commerce, Portals, and Forums are available now.
>Download today and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
>_______________________________________________
>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
_________________________________________________________________
Express yourself with cool emoticons - download MSN Messenger today!
http://www.msn.co.uk/messenger
|
|
From: Daniel G. <sp...@ho...> - 2003-07-03 16:25:26
|
Hey you guys hear that? I was correct!!! Ha ha! This feels great!
Cheers,
Daniel
>From: "Jorge Abramian" <jab...@ma...>
>Reply-To: <jab...@ma...>
>To: <dev...@li...>
>Subject: [Dev-C++] (no subject)
>Date: Thu, 3 Jul 2003 09:47:14 -0400
>
>Hey guys, thanks for the help,
>
>Actually Daniel Glenfield was write. I did not try Per W. solution that
>probably would work either.
>
>I changed the code to the followin and it worked well:
>
>/////////
> for (loop=0;loop<Number_of_Points;loop++)
> {
> DWORD dWritten;
> sprintf (temp,"\r\n","");
> WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
> sprintf (temp,"%3d",ran1[loop]);
> WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
> }
>/////////
>
>
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>Data Reports, E-commerce, Portals, and Forums are available now.
>Download today and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
>_______________________________________________
>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
_________________________________________________________________
Sign-up for a FREE BT Broadband connection today!
http://www.msn.co.uk/specials/btbroadband
|
|
From: Per W. <pw...@ia...> - 2003-07-03 17:15:32
|
But that ignores the problem that sizeof(temp) doesn't take into account
the number of characters in the buffer, only total declared size of it. As
such, sizeof(temp) should never be used for emitting text files unless you
really, really, really - did I say really? - know what you are doing.
strlen() is available specifically for checking the length of a string.
In the first WriteFile() call, temp contains 2 characters, a terminating
zero and an unknown number of extra garbage at the end - depending on what
size it was declared as.
In the second WriteFile() call, temp constans 3 characters, a terminating
zero and an unknown number of extra garbage.
Besides, sprintf(temp,"\r\n","") is a bit expensive since the formatting
string didn't contain any formatting. That is when strcpy(temp,"\r\n")
should be used.
Further, since the emitted string is a constant, why not directly emit
WriteFile(hFile,"\r\n",2,&dWritten,NULL);
Any why not check the return value and the value of dWritten? And - just
a bit more knit-picking - dWritten should be called dwWritten since it is
of type double-word.
/Per W
On Thu, 3 Jul 2003, Daniel Glenfield wrote:
> Hey you guys hear that? I was correct!!! Ha ha! This feels great!
>
> Cheers,
> Daniel
>
> >From: "Jorge Abramian" <jab...@ma...>
> >Reply-To: <jab...@ma...>
> >To: <dev...@li...>
> >Subject: [Dev-C++] (no subject)
> >Date: Thu, 3 Jul 2003 09:47:14 -0400
> >
> >Hey guys, thanks for the help,
> >
> >Actually Daniel Glenfield was write. I did not try Per W. solution that
> >probably would work either.
> >
> >I changed the code to the followin and it worked well:
> >
> >/////////
> > for (loop=0;loop<Number_of_Points;loop++)
> > {
> > DWORD dWritten;
> > sprintf (temp,"\r\n","");
> > WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
> > sprintf (temp,"%3d",ran1[loop]);
> > WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
> > }
> >/////////
> >
> >
> >
> >
> >-------------------------------------------------------
> >This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> >Data Reports, E-commerce, Portals, and Forums are available now.
> >Download today and enter to win an XBOX or Visual Studio .NET.
> >http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> >_______________________________________________
> >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
>
> _________________________________________________________________
> Sign-up for a FREE BT Broadband connection today!
> http://www.msn.co.uk/specials/btbroadband
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> _______________________________________________
> 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-07-03 19:02:11
|
Given the speed of processors now, something like that can hardly be called
expensive can it?
>From: Per Westermark <pw...@ia...>
>To: Daniel Glenfield <sp...@ho...>
>CC: jab...@ma...,
><dev...@li...>
>Subject: Re: [Dev-C++] (no subject)
>Date: Thu, 3 Jul 2003 19:17:12 +0200 (CEST)
>
>But that ignores the problem that sizeof(temp) doesn't take into account
>the number of characters in the buffer, only total declared size of it. As
>such, sizeof(temp) should never be used for emitting text files unless you
>really, really, really - did I say really? - know what you are doing.
>strlen() is available specifically for checking the length of a string.
>
>In the first WriteFile() call, temp contains 2 characters, a terminating
>zero and an unknown number of extra garbage at the end - depending on what
>size it was declared as.
>
>In the second WriteFile() call, temp constans 3 characters, a terminating
>zero and an unknown number of extra garbage.
>
>Besides, sprintf(temp,"\r\n","") is a bit expensive since the formatting
>string didn't contain any formatting. That is when strcpy(temp,"\r\n")
>should be used.
>
>Further, since the emitted string is a constant, why not directly emit
>WriteFile(hFile,"\r\n",2,&dWritten,NULL);
>
>Any why not check the return value and the value of dWritten? And - just
>a bit more knit-picking - dWritten should be called dwWritten since it is
>of type double-word.
>
>/Per W
>
>On Thu, 3 Jul 2003, Daniel Glenfield wrote:
>
> > Hey you guys hear that? I was correct!!! Ha ha! This feels great!
> >
> > Cheers,
> > Daniel
> >
> > >From: "Jorge Abramian" <jab...@ma...>
> > >Reply-To: <jab...@ma...>
> > >To: <dev...@li...>
> > >Subject: [Dev-C++] (no subject)
> > >Date: Thu, 3 Jul 2003 09:47:14 -0400
> > >
> > >Hey guys, thanks for the help,
> > >
> > >Actually Daniel Glenfield was write. I did not try Per W. solution that
> > >probably would work either.
> > >
> > >I changed the code to the followin and it worked well:
> > >
> > >/////////
> > > for (loop=0;loop<Number_of_Points;loop++)
> > > {
> > > DWORD dWritten;
> > > sprintf (temp,"\r\n","");
> > > WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
> > > sprintf (temp,"%3d",ran1[loop]);
> > > WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
> > > }
> > >/////////
> > >
> > >
> > >
> > >
> > >-------------------------------------------------------
> > >This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> > >Data Reports, E-commerce, Portals, and Forums are available now.
> > >Download today and enter to win an XBOX or Visual Studio .NET.
> >
> >http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> > >_______________________________________________
> > >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
> >
> > _________________________________________________________________
> > Sign-up for a FREE BT Broadband connection today!
> > http://www.msn.co.uk/specials/btbroadband
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> > Data Reports, E-commerce, Portals, and Forums are available now.
> > Download today and enter to win an XBOX or Visual Studio .NET.
> > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> > _______________________________________________
> > 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
> >
>
_________________________________________________________________
Express yourself with cool emoticons - download MSN Messenger today!
http://www.msn.co.uk/messenger
|
|
From: Per W. <pw...@ia...> - 2003-07-03 20:15:30
|
Sorry for coming out a bit rough but it's just that I think this issues
are important. Too many programs fails miserably because of this kind of
errors.
First of all - count the number of parameters used to
sprintf(temp,"\r\n","");
What would you say the third parameter was used for. Sending extra
parameters just because a variadric function allows it MUST be called
inefficient.
Second - do you notice any formatting character in the second parameter?
If not, then there is no need to call sprintf(), and strcpy() would
clearly be preferable to use.
Third - why talk about how expensive a line is, when - in reality - it
isn't needed at all. You might notice that
WriteFile(handle,"\r\n",2,&dwCount,NULL);
doesn't need the text to becopied to a temporary buffer before it is
emitted. Also, 2 is the correct number of characters to emit if the goal
is to generate a normal text file - at least until we aim for Unicode or
multi-byte encodings.
I'm pretty sure that temp wasn't declared as:
char temp[2]
so sizeof(temp) will most certainly result in an incorrect number of
characters being written.
Notice that
sprintf(temp,"\r\n");
would require 3 characters in temp, while
sprintf(temp,"%3d",x);
would require at least 4 - depending on the value of x.
Obviously, it isn't possible to emit the two strings to a text file
by using sizeof(temp). It wasn't possible in the original question either,
since sprintf() requires room an extra termination chaarcter. Either
temp[] would be large enough for that character - but then the termination
character would also be emitted. Or temp[] was just large enough for the
characters, but then sprintf() would have made a buffer overflow.
But still - the code didn't prove that -99 <= ran1[loop] <= 999. Without
that assumption, it isn't possible to predict the number of charactesr
that sprintf() needs when performing the %3d processing. Given a variable
number of characters in the formatted string, sizeof(temp) may never work,
and strlen(temp) must be used.
If emitting a binary file, sizeof(temp) is ok, since then temp[] might be
defined "large enough", and the program may safely ignore any random
characters emitted after the '\0' string termination and the full size of
the temp[] buffer. However, the use of "\r\n" in the output seems like a
very large indication that a binary fixed record-size file was intended.
/Per W
On Thu, 3 Jul 2003, Daniel Glenfield wrote:
> Given the speed of processors now, something like that can hardly be called
> expensive can it?
>
>
> >From: Per Westermark <pw...@ia...>
> >To: Daniel Glenfield <sp...@ho...>
> >CC: jab...@ma...,
> ><dev...@li...>
> >Subject: Re: [Dev-C++] (no subject)
> >Date: Thu, 3 Jul 2003 19:17:12 +0200 (CEST)
> >
> >But that ignores the problem that sizeof(temp) doesn't take into account
> >the number of characters in the buffer, only total declared size of it. As
> >such, sizeof(temp) should never be used for emitting text files unless you
> >really, really, really - did I say really? - know what you are doing.
> >strlen() is available specifically for checking the length of a string.
> >
> >In the first WriteFile() call, temp contains 2 characters, a terminating
> >zero and an unknown number of extra garbage at the end - depending on what
> >size it was declared as.
> >
> >In the second WriteFile() call, temp constans 3 characters, a terminating
> >zero and an unknown number of extra garbage.
> >
> >Besides, sprintf(temp,"\r\n","") is a bit expensive since the formatting
> >string didn't contain any formatting. That is when strcpy(temp,"\r\n")
> >should be used.
> >
> >Further, since the emitted string is a constant, why not directly emit
> >WriteFile(hFile,"\r\n",2,&dWritten,NULL);
> >
> >Any why not check the return value and the value of dWritten? And - just
> >a bit more knit-picking - dWritten should be called dwWritten since it is
> >of type double-word.
> >
> >/Per W
> >
> >On Thu, 3 Jul 2003, Daniel Glenfield wrote:
> >
> > > Hey you guys hear that? I was correct!!! Ha ha! This feels great!
> > >
> > > Cheers,
> > > Daniel
> > >
> > > >From: "Jorge Abramian" <jab...@ma...>
> > > >Reply-To: <jab...@ma...>
> > > >To: <dev...@li...>
> > > >Subject: [Dev-C++] (no subject)
> > > >Date: Thu, 3 Jul 2003 09:47:14 -0400
> > > >
> > > >Hey guys, thanks for the help,
> > > >
> > > >Actually Daniel Glenfield was write. I did not try Per W. solution that
> > > >probably would work either.
> > > >
> > > >I changed the code to the followin and it worked well:
> > > >
> > > >/////////
> > > > for (loop=0;loop<Number_of_Points;loop++)
> > > > {
> > > > DWORD dWritten;
> > > > sprintf (temp,"\r\n","");
> > > > WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
> > > > sprintf (temp,"%3d",ran1[loop]);
> > > > WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
> > > > }
> > > >/////////
> > > >
> > > >
> > > >
> > > >
> > > >-------------------------------------------------------
> > > >This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> > > >Data Reports, E-commerce, Portals, and Forums are available now.
> > > >Download today and enter to win an XBOX or Visual Studio .NET.
> > >
> > >http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> > > >_______________________________________________
> > > >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
> > >
> > > _________________________________________________________________
> > > Sign-up for a FREE BT Broadband connection today!
> > > http://www.msn.co.uk/specials/btbroadband
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> > > Data Reports, E-commerce, Portals, and Forums are available now.
> > > Download today and enter to win an XBOX or Visual Studio .NET.
> > > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> > > _______________________________________________
> > > 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
> > >
> >
>
> _________________________________________________________________
> Express yourself with cool emoticons - download MSN Messenger today!
> http://www.msn.co.uk/messenger
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> _______________________________________________
> 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: Per W. <pw...@ia...> - 2003-07-03 20:28:20
|
Oops, reversed logic of last sentence. It should of course say "wasn't
intended".
On Thu, 3 Jul 2003, Per Westermark wrote:
> Sorry for coming out a bit rough but it's just that I think this issues
> are important. Too many programs fails miserably because of this kind of
> errors.
>
> First of all - count the number of parameters used to
> sprintf(temp,"\r\n","");
> What would you say the third parameter was used for. Sending extra
> parameters just because a variadric function allows it MUST be called
> inefficient.
>
> Second - do you notice any formatting character in the second parameter?
> If not, then there is no need to call sprintf(), and strcpy() would
> clearly be preferable to use.
>
> Third - why talk about how expensive a line is, when - in reality - it
> isn't needed at all. You might notice that
> WriteFile(handle,"\r\n",2,&dwCount,NULL);
> doesn't need the text to becopied to a temporary buffer before it is
> emitted. Also, 2 is the correct number of characters to emit if the goal
> is to generate a normal text file - at least until we aim for Unicode or
> multi-byte encodings.
>
> I'm pretty sure that temp wasn't declared as:
> char temp[2]
> so sizeof(temp) will most certainly result in an incorrect number of
> characters being written.
>
> Notice that
> sprintf(temp,"\r\n");
> would require 3 characters in temp, while
> sprintf(temp,"%3d",x);
> would require at least 4 - depending on the value of x.
>
> Obviously, it isn't possible to emit the two strings to a text file
> by using sizeof(temp). It wasn't possible in the original question either,
> since sprintf() requires room an extra termination chaarcter. Either
> temp[] would be large enough for that character - but then the termination
> character would also be emitted. Or temp[] was just large enough for the
> characters, but then sprintf() would have made a buffer overflow.
>
> But still - the code didn't prove that -99 <= ran1[loop] <= 999. Without
> that assumption, it isn't possible to predict the number of charactesr
> that sprintf() needs when performing the %3d processing. Given a variable
> number of characters in the formatted string, sizeof(temp) may never work,
> and strlen(temp) must be used.
>
> If emitting a binary file, sizeof(temp) is ok, since then temp[] might be
> defined "large enough", and the program may safely ignore any random
> characters emitted after the '\0' string termination and the full size of
> the temp[] buffer. However, the use of "\r\n" in the output seems like a
> very large indication that a binary fixed record-size file was intended.
>
> /Per W
>
> On Thu, 3 Jul 2003, Daniel Glenfield wrote:
>
> > Given the speed of processors now, something like that can hardly be called
> > expensive can it?
> >
> >
> > >From: Per Westermark <pw...@ia...>
> > >To: Daniel Glenfield <sp...@ho...>
> > >CC: jab...@ma...,
> > ><dev...@li...>
> > >Subject: Re: [Dev-C++] (no subject)
> > >Date: Thu, 3 Jul 2003 19:17:12 +0200 (CEST)
> > >
> > >But that ignores the problem that sizeof(temp) doesn't take into account
> > >the number of characters in the buffer, only total declared size of it. As
> > >such, sizeof(temp) should never be used for emitting text files unless you
> > >really, really, really - did I say really? - know what you are doing.
> > >strlen() is available specifically for checking the length of a string.
> > >
> > >In the first WriteFile() call, temp contains 2 characters, a terminating
> > >zero and an unknown number of extra garbage at the end - depending on what
> > >size it was declared as.
> > >
> > >In the second WriteFile() call, temp constans 3 characters, a terminating
> > >zero and an unknown number of extra garbage.
> > >
> > >Besides, sprintf(temp,"\r\n","") is a bit expensive since the formatting
> > >string didn't contain any formatting. That is when strcpy(temp,"\r\n")
> > >should be used.
> > >
> > >Further, since the emitted string is a constant, why not directly emit
> > >WriteFile(hFile,"\r\n",2,&dWritten,NULL);
> > >
> > >Any why not check the return value and the value of dWritten? And - just
> > >a bit more knit-picking - dWritten should be called dwWritten since it is
> > >of type double-word.
> > >
> > >/Per W
> > >
> > >On Thu, 3 Jul 2003, Daniel Glenfield wrote:
> > >
> > > > Hey you guys hear that? I was correct!!! Ha ha! This feels great!
> > > >
> > > > Cheers,
> > > > Daniel
> > > >
> > > > >From: "Jorge Abramian" <jab...@ma...>
> > > > >Reply-To: <jab...@ma...>
> > > > >To: <dev...@li...>
> > > > >Subject: [Dev-C++] (no subject)
> > > > >Date: Thu, 3 Jul 2003 09:47:14 -0400
> > > > >
> > > > >Hey guys, thanks for the help,
> > > > >
> > > > >Actually Daniel Glenfield was write. I did not try Per W. solution that
> > > > >probably would work either.
> > > > >
> > > > >I changed the code to the followin and it worked well:
> > > > >
> > > > >/////////
> > > > > for (loop=0;loop<Number_of_Points;loop++)
> > > > > {
> > > > > DWORD dWritten;
> > > > > sprintf (temp,"\r\n","");
> > > > > WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
> > > > > sprintf (temp,"%3d",ran1[loop]);
> > > > > WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
> > > > > }
> > > > >/////////
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >-------------------------------------------------------
> > > > >This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> > > > >Data Reports, E-commerce, Portals, and Forums are available now.
> > > > >Download today and enter to win an XBOX or Visual Studio .NET.
> > > >
> > > >http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> > > > >_______________________________________________
> > > > >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
> > > >
> > > > _________________________________________________________________
> > > > Sign-up for a FREE BT Broadband connection today!
> > > > http://www.msn.co.uk/specials/btbroadband
> > > >
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> > > > Data Reports, E-commerce, Portals, and Forums are available now.
> > > > Download today and enter to win an XBOX or Visual Studio .NET.
> > > > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> > > > _______________________________________________
> > > > 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
> > > >
> > >
> >
> > _________________________________________________________________
> > Express yourself with cool emoticons - download MSN Messenger today!
> > http://www.msn.co.uk/messenger
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> > Data Reports, E-commerce, Portals, and Forums are available now.
> > Download today and enter to win an XBOX or Visual Studio .NET.
> > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> > _______________________________________________
> > 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
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> _______________________________________________
> 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: pErCivaL <pma...@nt...> - 2003-07-04 03:11:14
|
> --__--__--
>
> Message: 12
> From: "Daniel Glenfield" <sp...@ho...>
> To: pw...@ia...
> Cc: jab...@ma..., dev-cpp-
>
> Given the speed of processors now, something like that can hardly be
> called expensive can it?
...that is if you're applications are PC bound!
what if it's for embedded systems... you can't have much processor speed in
there.
>
>> From: Per Westermark <pw...@ia...>
>> To: Daniel Glenfield <sp...@ho...>
>> CC: jab...@ma..., <dev-cpp-
>> us...@li...>
>> Subject: Re: [Dev-C++] (no subject)
>> Date: Thu, 3 Jul 2003 19:17:12 +0200 (CEST)
>>
>> But that ignores the problem that sizeof(temp) doesn't take into account
>> the number of characters in the buffer, only total declared size of it.
>> As
>> such, sizeof(temp) should never be used for emitting text files unless
>> you
>> really, really, really - did I say really? - know what you are doing.
>> strlen() is available specifically for checking the length of a string.
>>
>> In the first WriteFile() call, temp contains 2 characters, a terminating
>> zero and an unknown number of extra garbage at the end - depending on
>> what
>> size it was declared as.
>>
>> In the second WriteFile() call, temp constans 3 characters, a
>> terminating
>> zero and an unknown number of extra garbage.
>>
>> Besides, sprintf(temp,"\r\n","") is a bit expensive since the formatting
>> string didn't contain any formatting. That is when strcpy(temp,"\r\n")
>> should be used.
>>
>> Further, since the emitted string is a constant, why not directly emit
>> WriteFile(hFile,"\r\n",2,&dWritten,NULL);
>>
>> Any why not check the return value and the value of dWritten? And - just
>> a bit more knit-picking - dWritten should be called dwWritten since it
>> is
>> of type double-word.
>>
>> /Per W
>>
>> On Thu, 3 Jul 2003, Daniel Glenfield wrote:
>>
>> > Hey you guys hear that? I was correct!!! Ha ha! This feels great!
>> >
>> > Cheers,
>> > Daniel
>> >
>> > >From: "Jorge Abramian" <jab...@ma...>
>> > >Reply-To: <jab...@ma...>
>> > >To: <dev...@li...>
>> > >Subject: [Dev-C++] (no subject)
>> > >Date: Thu, 3 Jul 2003 09:47:14 -0400
>> > >
>> > >Hey guys, thanks for the help,
>> > >
>> > >Actually Daniel Glenfield was write. I did not try Per W. solution
>> that
>> > >probably would work either.
>> > >
>> > >I changed the code to the followin and it worked well:
>> > >
>> > >/////////
>> > > for (loop=0;loop<Number_of_Points;loop++)
>> > > {
>> > > DWORD dWritten;
>> > > sprintf (temp,"\r\n","");
>> > > WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
>> > > sprintf (temp,"%3d",ran1[loop]);
>> > > WriteFile(hFile, temp, sizeof(temp),&dWritten, NULL);
>> > > }
>> > >/////////
>> > >
>> > >
>> > >
>> > >
>> > >-------------------------------------------------------
>> > >This SF.Net email sponsored by: Free pre-built ASP.NET sites
>> including
>> > >Data Reports, E-commerce, Portals, and Forums are available now.
>> > >Download today and enter to win an XBOX or Visual Studio .NET.
>> > >http://aspnet.click-
>> url.com/go/psa00100006ave/direct;at.asp_061203_01/01
>> > >_______________________________________________
>> > >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
>> >
>> > _________________________________________________________________
>> > Sign-up for a FREE BT Broadband connection today!
>> > http://www.msn.co.uk/specials/btbroadband
>> >
>> >
>> >
>> > -------------------------------------------------------
>> > This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>> > Data Reports, E-commerce, Portals, and Forums are available now.
>> > Download today and enter to win an XBOX or Visual Studio .NET.
>> > http://aspnet.click-
>> url.com/go/psa00100006ave/direct;at.asp_061203_01/01
>> > _______________________________________________
>> > 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
>> >
>>
>
> _________________________________________________________________
> Express yourself with cool emoticons - download MSN Messenger today!
> http://www.msn.co.uk/messenger
>
>
>
>
> --__--__--
>
> _______________________________________________
> 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
>
>
--
Data asks, "Sir, how is it that the Q can handle time and space so well and
us so badly?" and Picard replies aphoristically, "Perhaps someday we will
discover that space and time are simpler than the human equation."
mortality gives life focus and purpose
****************************************************
WARNING: All e-mail sent to and from this address will be received or
otherwise recorded by the BrainStorm CyberWarfare e-mail system and is
subject to archival, monitoring or review by, and/or disclosure to, someone
other than the recipient.
****************************************************
|
|
From: Daniel G. <sp...@ho...> - 2003-07-24 06:20:33
|
Thanks Ioannis, that's very interesting indeed! Does windows keep these encrypted passwords in a file then or memory somewhere? >From: "Ioannis Vranos" <iv...@em...> >To: "Dev-C++ Mailing List" <dev...@li...> >Subject: [Dev-C++] (no subject) >Date: Thu, 24 Jul 2003 00:52:00 +0300 > >I think this is interesting for everyone in the list, so I thought to drop >it in here. > > > >From WinInfo Daily Update: > >=== 1. News and Views ==== > by Paul Thurrott, thu...@wi... > >Researchers Crack Windows Passwords in Seconds > Swiss researchers have developed a password-cracking scheme, based >on a method first developed in 1980, that lets them crack most Windows >passwords in about 13 seconds (the original method takes more than a >minute and a half longer). The scheme enforces a growing concern in >the security community that the way in which Microsoft encodes >passwords in Windows is inherently weak, opening the door for cracking >programs to use brute-force methods to test and break passwords. > Philippe Oechslin, one of the Swiss researchers, recently published >an online paper, "Making a Faster Cryptanalytic Time-Memory >Trade-Off," which highlights the new password-cracking scheme. >Oechslin will present the paper in August at Crypto 2003, an >international cryptology conference held this year at the University >of California, Santa Barbara and organized by the International >Association for Cryptologic Research (IACR) in cooperation with the >IEEE Computer Society Technical Committee on Security and Privacy. > "As an example, we have implemented an attack on MS-Windows >password hashes," the researchers write. "Using 1.4GB of data (two >CD-ROMs) we can crack 99.9 percent of all alphanumerical passwords >hashes ... in 13.6 seconds whereas it takes 101 seconds with the >current approach using distinguished points. We show that the gain >could be even much higher depending on the parameters used." > Oddly, the researchers weren't interested in cracking Windows >passwords but rather were trying to demonstrate the previous >theoretical cryptanalytic time-memory trade-off technique. They note >that Microsoft's passwords are weak because, when encrypted, they >don't include any random information. Thus, the same password on two >Windows machines will always be the same when encrypted, which makes >breaking the password encryption much easier than if the passwords >were randomized. > Although generating more secure passwords by using nonalphanumeric >characters and other special characters is possible, the researchers >say that even this approach won't solve the inherent problem in >Windows because all they'd need is more time or a larger data set (or >both) to crack those passwords as well. Instead, Microsoft will have >to fix this feature to encrypt passwords with random information, the >researchers say. > >---------------------------------------------------------------------------- >----------------------- > > > > > > >Ioannis Vranos > >* Programming pages: http://www.noicys.freeurl.com >* Alternative URL 1: http://run.to/noicys >* Alternative URL 2: http://www.noicys.cjb.net > > > > >------------------------------------------------------- >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >Data Reports, E-commerce, Portals, and Forums are available now. >Download today and enter to win an XBOX or Visual Studio .NET. >http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Express yourself with cool emoticons - download MSN Messenger today! http://www.msn.co.uk/messenger |
|
From: David M. <ci...@ya...> - 2003-07-24 19:37:12
|
Not sure if this still applies but there is a SAM file located somewhere in the system32 directory. Problem with this file is not even an administrator can open it! NT locks it down as soon as it starts (anyone got a NTFS reader?) --- Daniel Glenfield <sp...@ho...> wrote: > > Thanks Ioannis, that's very interesting indeed! Does > windows keep these > encrypted passwords in a file then or memory somewhere? > > >From: "Ioannis Vranos" <iv...@em...> > >To: "Dev-C++ Mailing List" > <dev...@li...> > >Subject: [Dev-C++] (no subject) > >Date: Thu, 24 Jul 2003 00:52:00 +0300 > > > >I think this is interesting for everyone in the list, so > I thought to drop > >it in here. > > > > > > > >From WinInfo Daily Update: > > > >=== 1. News and Views ==== > > by Paul Thurrott, thu...@wi... > > > >Researchers Crack Windows Passwords in Seconds > > Swiss researchers have developed a password-cracking > scheme, based > >on a method first developed in 1980, that lets them > crack most Windows > >passwords in about 13 seconds (the original method takes > more than a > >minute and a half longer). The scheme enforces a growing > concern in > >the security community that the way in which Microsoft > encodes > >passwords in Windows is inherently weak, opening the > door for cracking > >programs to use brute-force methods to test and break > passwords. > > Philippe Oechslin, one of the Swiss researchers, > recently published > >an online paper, "Making a Faster Cryptanalytic > Time-Memory > >Trade-Off," which highlights the new password-cracking > scheme. > >Oechslin will present the paper in August at Crypto > 2003, an > >international cryptology conference held this year at > the University > >of California, Santa Barbara and organized by the > International > >Association for Cryptologic Research (IACR) in > cooperation with the > >IEEE Computer Society Technical Committee on Security > and Privacy. > > "As an example, we have implemented an attack on > MS-Windows > >password hashes," the researchers write. "Using 1.4GB of > data (two > >CD-ROMs) we can crack 99.9 percent of all alphanumerical > passwords > >hashes ... in 13.6 seconds whereas it takes 101 seconds > with the > >current approach using distinguished points. We show > that the gain > >could be even much higher depending on the parameters > used." > > Oddly, the researchers weren't interested in > cracking Windows > >passwords but rather were trying to demonstrate the > previous > >theoretical cryptanalytic time-memory trade-off > technique. They note > >that Microsoft's passwords are weak because, when > encrypted, they > >don't include any random information. Thus, the same > password on two > >Windows machines will always be the same when encrypted, > which makes > >breaking the password encryption much easier than if the > passwords > >were randomized. > > Although generating more secure passwords by using > nonalphanumeric > >characters and other special characters is possible, the > researchers > >say that even this approach won't solve the inherent > problem in > >Windows because all they'd need is more time or a larger > data set (or > >both) to crack those passwords as well. Instead, > Microsoft will have > >to fix this feature to encrypt passwords with random > information, the > >researchers say. > > > >---------------------------------------------------------------------------- > >----------------------- > > > > > > > > > > > > > >Ioannis Vranos > > > >* Programming pages: http://www.noicys.freeurl.com > >* Alternative URL 1: http://run.to/noicys > >* Alternative URL 2: http://www.noicys.cjb.net > > > > > > > > > >------------------------------------------------------- > >This SF.Net email sponsored by: Free pre-built ASP.NET > sites including > >Data Reports, E-commerce, Portals, and Forums are > available now. > >Download today and enter to win an XBOX or Visual Studio > .NET. > >http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > >_______________________________________________ > >Dev-cpp-users mailing list > >Dev...@li... > >TO UNSUBSCRIBE: > http://www23.brinkster.com/noicys/devcpp/ub.htm > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > _________________________________________________________________ > Express yourself with cool emoticons - download MSN > Messenger today! > http://www.msn.co.uk/messenger > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET > sites including > Data Reports, E-commerce, Portals, and Forums are > available now. > Download today and enter to win an XBOX or Visual Studio > .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: > http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users ===== Signed David Mcken Life Sucks Live with it __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
|
From: Abhijit S. <mu...@gm...> - 2003-07-24 20:00:08
|
> Not sure if this still applies but there is a SAM file > located somewhere in the system32 directory. Problem with > this file is not even an administrator can open it! NT > locks it down as soon as it starts (anyone got a NTFS > reader?) > Yup, reasonably new versions of Linux can read NTFS. from DOS (freeware, untested): http://download.com.com/3000-2094-10126096.html You said NT locks the file as soon as it starts, does that extend to driver-load time? I mean, by `start' do you mean the user-visible start or the actual kernel load? If not, one could theoretically write a fake driver that can access the file. I wouldn't be surprised if Windows had a hole like that. -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
|
From: <or...@vp...> - 2003-07-24 20:31:02
|
Abhijit Shylanath wrote: > You said NT locks the file as soon as it starts, does that extend to > driver-load time? I mean, by `start' do you mean the user-visible start or > the actual kernel load? If not, one could theoretically write a fake driver > that can access the file. I wouldn't be surprised if Windows had a hole like > that. Who knows if this hole is a wanted "feature" by M$? To turn a bit away from the subject: I doubt that the so famous nimda virus has found security holes. I think they were actually not holes, but backdoors left for M$, so that they can access your server anytime, without you knowing of it. Sometimes the virus writers find these backdoors, left by M$. Just read the EULA of Windows XP, you'll find strange things there. Another thing might be, what if nimda was actually the creation of M$ itself? I mean, to scare some high guy. Of course, this is all fiction, but it is still starnge, that nimda's spreading algorithm was "incorrect", so it was spreading too slow. I doubt that a virus writer, who can write a so perfect virus, located HUGE security holes (or backdoors) would write an incorrect spreading algorithm. I don't know exactly how it worked, I just know that if it was written good, nimda would have infected ALL M$ servers. Just my brain-foolishness... -- Greetings, Balázs |
|
From: Ioannis V. <iv...@em...> - 2003-07-24 20:49:06
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Abhijit Shylanath > Sent: Thursday, July 24, 2003 11:01 PM > To: ci...@ya...; Dev-C Mailing List > Subject: RE: [Dev-C++] (no subject) >=20 >=20 >=20 > > Not sure if this still applies but there is a SAM file > > located somewhere in the system32 directory. Problem with > > this file is not even an administrator can open it! NT > > locks it down as soon as it starts (anyone got a NTFS > > reader?) > > >=20 > Yup, reasonably new versions of Linux can read NTFS. from DOS=20 > (freeware, > untested): > http://download.com.com/3000-2094-10126096.html >=20 > You said NT locks the file as soon as it starts, does that extend to > driver-load time? I mean, by `start' do you mean the=20 > user-visible start or > the actual kernel load? If not, one could theoretically write=20 > a fake driver > that can access the file. I wouldn't be surprised if Windows=20 > had a hole like > that. A file-system by itself does not potect anything. The access properties = of files and folders make sense only when you access them through the = specific OS. So NTFS can be read by other Oses, the same as ext2fs and other file systems of GNU/Linux. When I couldn't login to Win2K in the past because some application messed up the OS I did not lose my files. I = reinstallled Win2k without reformating the drive, I was getting my files to a CD and = then made a clean install (with formatting of the HDD). The same things apply to all OSes including GNU/Linux. If you want to = secure your files against theft you have to encrypt them, either using a third-party program or facilities of the OS. NTFS in Windows 2000 and later provides the ability for encryption using = a key randomly produced for each account. Programs that reset the password from the outside by deleting or editing some file (I do not know the OS internals) have also aas a result that key to be erased so files = encrypted via EFS (the encryption part of NTFS) from that user account become unaccessible. 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 |
|
From: David M. <ci...@ya...> - 2003-07-25 03:22:00
|
What I was more looking to point out was the password some one uses to access their accout could also be their e-mail account password as well as the password for other accounts. If you are able to retrive the original password you open alot of posibilities. ----- Original Message ----- From: "Per Westermark" <pw...@ia...> To: "David McKen" <ci...@ya...> Cc: "Dev-C Mailing List" <dev...@li...> Sent: Thursday, July 24, 2003 3:42 PM Subject: Re: [Dev-C++] (no subject) > Bug without knowing the pwd, it is possible to set a known one, do some > nice things, and then set back the original - without knowing what the > original pwd was. > > /Per W > > On Thu, 24 Jul 2003, David McKen wrote: > > > Being able to get the old is worse because the user will > > not notice that it has changed and a careful person can > > make it so that no (or rather very few) other traces are > > left. > > > > To make matters worse, many people re-use passwords (makes > > it easier to rember) > > > > --- Per Westermark <pw...@ia...> wrote: > > > One more thing - this information is about cracking a > > > password, i.e. > > > finding out what it is. If I don't bother, there are a > > > number of programs > > > available what will allow setting a new password without > > > knowing the old. > > > > > > /Per W > > > > > > On Thu, 24 Jul 2003, Ioannis Vranos wrote: > > > > > > > I think this is interesting for everyone in the list, > > > so I thought to drop > > > > it in here. > > > > > > > > > > > > > > > > >From WinInfo Daily Update: > > > > > > > > === 1. News and Views ==== > > > > by Paul Thurrott, thu...@wi... > > > > > > > > Researchers Crack Windows Passwords in Seconds > > > > Swiss researchers have developed a password-cracking > > > scheme, based > > > > on a method first developed in 1980, that lets them > > > crack most Windows > > > > passwords in about 13 seconds (the original method > > > takes more than a > > > > minute and a half longer). The scheme enforces a > > > growing concern in > > > > the security community that the way in which Microsoft > > > encodes > > > > passwords in Windows is inherently weak, opening the > > > door for cracking > > > > programs to use brute-force methods to test and break > > > passwords. > > > > Philippe Oechslin, one of the Swiss researchers, > > > recently published > > > > an online paper, "Making a Faster Cryptanalytic > > > Time-Memory > > > > Trade-Off," which highlights the new password-cracking > > > scheme. > > > > Oechslin will present the paper in August at Crypto > > > 2003, an > > > > international cryptology conference held this year at > > > the University > > > > of California, Santa Barbara and organized by the > > > International > > > > Association for Cryptologic Research (IACR) in > > > cooperation with the > > > > IEEE Computer Society Technical Committee on Security > > > and Privacy. > > > > "As an example, we have implemented an attack on > > > MS-Windows > > > > password hashes," the researchers write. "Using 1.4GB > > > of data (two > > > > CD-ROMs) we can crack 99.9 percent of all > > > alphanumerical passwords > > > > hashes ... in 13.6 seconds whereas it takes 101 seconds > > > with the > > > > current approach using distinguished points. We show > > > that the gain > > > > could be even much higher depending on the parameters > > > used." > > > > Oddly, the researchers weren't interested in > > > cracking Windows > > > > passwords but rather were trying to demonstrate the > > > previous > > > > theoretical cryptanalytic time-memory trade-off > > > technique. They note > > > > that Microsoft's passwords are weak because, when > > > encrypted, they > > > > don't include any random information. Thus, the same > > > password on two > > > > Windows machines will always be the same when > > > encrypted, which makes > > > > breaking the password encryption much easier than if > > > the passwords > > > > were randomized. > > > > Although generating more secure passwords by using > > > nonalphanumeric > > > > characters and other special characters is possible, > > > the researchers > > > > say that even this approach won't solve the inherent > > > problem in > > > > Windows because all they'd need is more time or a > > > larger data set (or > > > > both) to crack those passwords as well. Instead, > > > Microsoft will have > > > > to fix this feature to encrypt passwords with random > > > information, the > > > > researchers say. > > > > > > > > > > > > > -------------------------------------------------------------------------- -- > > > > ----------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > Ioannis Vranos > > > > > > > > * Programming pages: http://www.noicys.freeurl.com > > > > * Alternative URL 1: http://run.to/noicys > > > > * Alternative URL 2: http://www.noicys.cjb.net > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.Net email sponsored by: Free pre-built ASP.NET > > > sites including > > > > Data Reports, E-commerce, Portals, and Forums are > > > available now. > > > > Download today and enter to win an XBOX or Visual > > > Studio .NET. > > > > > > > > > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > > > > _______________________________________________ > > > > Dev-cpp-users mailing list > > > > Dev...@li... > > > > TO UNSUBSCRIBE: > > > http://www23.brinkster.com/noicys/devcpp/ub.htm > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email sponsored by: Free pre-built ASP.NET > > > sites including > > > Data Reports, E-commerce, Portals, and Forums are > > > available now. > > > Download today and enter to win an XBOX or Visual Studio > > > .NET. > > > > > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: > > > http://www23.brinkster.com/noicys/devcpp/ub.htm > > > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > ===== > > Signed > > David Mcken > > > > Life Sucks > > Live with it > > > > __________________________________ > > Do you Yahoo!? > > The New Yahoo! Search - Faster. Easier. Bingo. > > http://search.yahoo.com > > > > > > ------------------------------------------------------- > > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > > Data Reports, E-commerce, Portals, and Forums are available now. > > Download today and enter to win an XBOX or Visual Studio .NET. > > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
|
From: Daniel G. <sp...@ho...> - 2003-08-18 12:10:58
|
I think he means the console background colour. >From: OROSZI Balázs <or...@vp...> >To: dev...@li... >Subject: Re: [Dev-C++] (no subject) >Date: Sat, 16 Aug 2003 09:56:37 +0200 > >yiwei li wrote: >>hihi is there anyone here know how to change the background color of where >>you run the programme (not the text color). Thanks > >Is there anyone, who understands this question? :) > >-- >Greetings, > Balázs > > > > >------------------------------------------------------- >This SF.Net email sponsored by: Free pre-built ASP.NET sites including >Data Reports, E-commerce, Portals, and Forums are available now. >Download today and enter to win an XBOX or Visual Studio .NET. >http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile |