Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Read a file line by line and write each line to a file based on the5th byte

Reply
Thread Tools

Read a file line by line and write each line to a file based on the5th byte

 
 
Jerry Coffin
Guest
Posts: n/a
 
      05-17-2009
In article <guoosa$f19$>,
says...
> * James Kanze:


[ ... ]

> > But who'd want to use g++ under Windows anyway.

>
> Anybody serious about programming.


Not even close.

> It's a good idea to have the code compile with at least two compilers.


While reasonable in itself, that's not an argument in favor of g++. One
of the two should normally be the system's "native" compiler (VC++, in
the case of Windows). If you honestly care about the quality of your
code, the second compiler should Comeau -- g++ is sadly deficient by
comparison.

--
Later,
Jerry.

The universe is a figment of its own imagination.
 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      05-17-2009
On May 17, 12:26 pm, "Alf P. Steinbach" <al...@start.no> wrote:
> * James Kanze:
> > On May 16, 4:10 pm, "Alf P. Steinbach" <al...@start.no> wrote:
> >> * James Kanze:


> > [...]
> >>> Not just for reasons of having a [] which crashes. (I'm
> >>> less sure about VC++, but pre-4.0 g++ didn't have fully
> >>> standard name look-up.)


> >> The lastest version of g++ for Windows is AFAIK 3.4.5.


> > Whose last version?


> > MSys has a 4.3.0, qualified "Testing"; the last stable
> > version is 3.4.5, as you say, but a newer version is
> > available. Cygwin has 4.3.2 (plus a lot of others); I'm
> > unable to find any statement concerning what they consider
> > "stable". I don't know about the others.


> > But who'd want to use g++ under Windows anyway.


> Anybody serious about programming.


I consider myself serious about programming, but what little
work I do under Windows is purely with VC++.

> It's a good idea to have the code compile with at least two
> compilers.


There's that, of course---ideally, the second compiler would be
Comeau, regardless of the platform. (Still no need for g++.)

Of course, the same reasoning applies to OS's---it's a good idea
to ensure that your code can work under two different OS's. And
given the price of Linux, and the fact that it will dual boot
with Windows, there's no real reason not to.

But of course, the same reasoning applies to architectures. I
generally ensure that my code compiles (and runs) on a Sparc, as
well as both 32 and 64 bit Intel---I'd like to have more
possibilities, but it's not that easy. (A mainframe is a
bit out of my budget at home, and my employer doesn't supply
one, so I'm stuck with nothing but IEEE floating point.)

Of course, some applications really are single platform.

--
James Kanze (GABI Software) email:
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
 
Reply With Quote
 
 
 
 
Alf P. Steinbach
Guest
Posts: n/a
 
      05-17-2009
* James Kanze:
> On May 17, 12:26 pm, "Alf P. Steinbach" <al...@start.no> wrote:
>> * James Kanze:
>>> On May 16, 4:10 pm, "Alf P. Steinbach" <al...@start.no> wrote:
>>>> * James Kanze:

>
>>> [...]
>>>>> Not just for reasons of having a [] which crashes. (I'm
>>>>> less sure about VC++, but pre-4.0 g++ didn't have fully
>>>>> standard name look-up.)

>
>>>> The lastest version of g++ for Windows is AFAIK 3.4.5.

>
>>> Whose last version?

>
>>> MSys has a 4.3.0, qualified "Testing"; the last stable
>>> version is 3.4.5, as you say, but a newer version is
>>> available. Cygwin has 4.3.2 (plus a lot of others); I'm
>>> unable to find any statement concerning what they consider
>>> "stable". I don't know about the others.

>
>>> But who'd want to use g++ under Windows anyway.

>
>> Anybody serious about programming.

>
> I consider myself serious about programming, but what little
> work I do under Windows is purely with VC++.


Well. It stands to reason that *someone* must be using the second most used
compiler on the platform, i.e., that your choice is not representative.


>> It's a good idea to have the code compile with at least two
>> compilers.

>
> There's that, of course---ideally, the second compiler would be
> Comeau, regardless of the platform. (Still no need for g++.)


No, don't get hung up on the "two", focus on the "at least".

Comeau tests standard-conformance only.

One main reason you need two or more compilers is that compilers aren't
standard-conforming.

Testing with Comeau only, doesn't ensure your code will work with g++.

Testing with g++ does help in that direction.


Cheers & hth.,

- Alf


--
Due to hosting requirements I need visits to <url: http://alfps.izfree.com/>.
No ads, and there is some C++ stuff! Just going there is good. Linking
to it is even better! Thanks in advance!
 
Reply With Quote
 
Alf P. Steinbach
Guest
Posts: n/a
 
      05-17-2009
* Jerry Coffin:
> In article <guoosa$f19$>,
> says...
>> * James Kanze:

>
> [ ... ]
>
>>> But who'd want to use g++ under Windows anyway.

>> Anybody serious about programming.

>
> Not even close.
>
>> It's a good idea to have the code compile with at least two compilers.

>
> While reasonable in itself, that's not an argument in favor of g++. One
> of the two should normally be the system's "native" compiler (VC++, in
> the case of Windows). If you honestly care about the quality of your
> code, the second compiler should Comeau -- g++ is sadly deficient by
> comparison.


No (and by the way, I don't accept "the second", it's just silly).

See reply to James else-thread.


Cheers & hth.,

- Alf

--
Due to hosting requirements I need visits to <url: http://alfps.izfree.com/>.
No ads, and there is some C++ stuff! Just going there is good. Linking
to it is even better! Thanks in advance!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 6.14 How do I process each word on each line? PerlFAQ Server Perl Misc 0 04-08-2011 04:00 AM
FAQ 6.14 How do I process each word on each line? PerlFAQ Server Perl Misc 0 01-26-2011 11:00 PM
read text file byte by byte daved170 Python 30 12-16-2009 09:54 PM
how to read/write a characters stream which is either of one byte/2 byte Deep C Programming 6 02-28-2007 01:03 PM
read/write data byte-per-byte to and from a socket crash.test.dummy Java 1 02-17-2006 06:18 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57