Re: return the start of a substring in a string in c




"Ian Collins" <ian-news@xxxxxxxxxxx> wrote in message news:5g525qF3e3g6kU1@xxxxxxxxxxxxxxxxxxxxx
Malcolm McLean wrote:

"Eric Sosman" <Eric.Sosman@xxxxxxx> wrote in message
news:1184708470.948105@xxxxxxxxxxx
Malcolm McLean wrote On 07/17/07 17:06,:
[...] However it
obvious that C has too many integer types; short, int, long, long
long, in
signed and unsigned, size_t and ptrdiff_t.

Drat! My obviousness detector must be on the fritz
again. Probably forgot to pay my platitude purveyor.

That's ten standards for
representing an integer.

... to accompany three looping constructs, two ways
to exit, and a partridge in a pear tree. What's wrong
with an expressive vocabulary? Are you an aficionado of
Newspeak, perchance?

The difference is that the integer representation is the way that
functions talk to each other.
No one minds ten different kinds of kettles in the shop. However when
you've got ten different standards for plugs it becomes a real problem.

Unless you have 10 standards for sockets.

So we've got ten different plugs, and ten different matching sockets. If your kitchen socket doesn't match the plug of the kettle you want, you can buy an adapter, but there are ninety of them.

Try controlling real hardware with only one integer type.

That's partly why I insist on separating IO from logic. It is a lot easier said than done.
But code that interacts with hardware devices using bits is inherently non-portable anyway. It won't become any less portable if you use a platform-specific extension.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

.



Relevant Pages

  • Re: FGW Refurb
    ... The table sockets are of an extremely poor design. ... I don't doubt that the sockets don't help but the designers of power ... While I believe you're correct - many plugs are badly designed, ...
    (uk.railway)
  • Re: Amazing prices for HDMI cables
    ... phone and din plugs and sockets in various ways. ... And din line sockets - despite being sneered at by many audiophiles - were ... contamination that eventually produced contact diode effects quite visible ...
    (uk.tech.digital-tv)
  • Re: Mains networking - attn Oz
    ... dchp sorts the connection out automagically. ... There is a slight problem in that the plugs need stranded ... If the cables have prefitted plugs then you need rather a BIG hole ... I understand the preferred answer is fixed sockets, ...
    (uk.business.agriculture)
  • Re: UK / USA Tool Terminology Translator
    ... > Allen Key: hex key, hex wrench, Allen wrench ... > banana plugs: wander plugs ... > plugs and sockets ... > phono connectors: RCA connectors ...
    (sci.electronics.repair)
  • Re: Soild State switch for welder, good idea?
    ... Imagine grown-up banana plugs and sockets. ... I have a Lincoln AC/DC tombstone welder that needs removable leads. ... You can buy the sockets and plugs at a welding supply. ... It now takes seconds to switch from ac to dc and back. ...
    (rec.crafts.metalworking)