Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > sob..Someone can help me????plsss

Reply
Thread Tools

sob..Someone can help me????plsss

 
 
pete
Guest
Posts: n/a
 
      09-21-2007
pete wrote:
>
> http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> >
> > On Sep 20, 2:39 pm, (E-Mail Removed) wrote:
> > > please key in any 5 digits number : 56789
> > >
> > > and the ouput is
> > > 5678 9
> > > 567 89
> > > 56 789
> > > 5 6789


> It's really a string problem and not a math problem.
>
> /* BEGIN new.c */
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <ctype.h>
>
> #define LENGTH 5
> #define str(x) # x
> #define xstr(x) str(x)
>
> int main(void)
> {
> int rc;
> char array[LENGTH + 1];
> size_t index, space, loop;
>
> fputs("please key in any 5 digits number :", stdout);


I like this better:

printf("please key in any " xstr(LENGTH) " digits number :");

--
pete
 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      09-21-2007
Army1987 said:

> On Thu, 20 Sep 2007 18:35:43 -0400, CBFalconer wrote:
>
>> What are all those dots for? Sentences are normally terminated
>> with a period (one dot) followed by two spaces.

> Not by everybody. Many people follow it with one space.


The two-space gap between sentences goes back to typewriting with a
fixed-pitch font. It was considered to be more aesthetically pleasing than
a single space, although really two spaces was a little too much (but one
space wasn't quite enough!). With the advent of smart word processors that
could put an aesthetically decent gap between one sentence and the next,
given only the hint of a full stop and a space, the practice faded out,
even in Usenet, where fixed-pitch fonts are the norm (presumably because
many people do more typing in word processors or other programs with
proportional fonts than in fixed-pitch programs such as text editors and
good Usenet clients).

I've been using one space as a sentence separator for so long that I cannot
now remember when I made the switch from two spaces.

I'm trying to think up a way to link this to C, but not having a great deal
of success.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
 
Reply With Quote
 
 
 
 
Richard Bos
Guest
Posts: n/a
 
      09-21-2007
CBFalconer <(E-Mail Removed)> wrote:

> (E-Mail Removed) wrote:
> >
> > ceh my teacher is totally jerk........now he ask me to do in looping
> > humm.....i think maybe i can use for...nvm i will try to do on my
> > own...
> > i will ask if got any prob....
> > i think must use nested for...

>
> What are all those dots for? Sentences are normally terminated
> with a period (one dot) followed by two spaces.


One space, in civilised countries.

Richard
 
Reply With Quote
 
Flash Gordon
Guest
Posts: n/a
 
      09-21-2007
Richard Heathfield wrote, On 21/09/07 01:52:
> Army1987 said:
>
>> On Thu, 20 Sep 2007 18:35:43 -0400, CBFalconer wrote:
>>
>>> What are all those dots for? Sentences are normally terminated
>>> with a period (one dot) followed by two spaces.

>> Not by everybody. Many people follow it with one space.

>
> The two-space gap between sentences goes back to typewriting with a
> fixed-pitch font. It was considered to be more aesthetically pleasing than
> a single space, although really two spaces was a little too much (but one
> space wasn't quite enough!). With the advent of smart word processors that
> could put an aesthetically decent gap between one sentence and the next,
> given only the hint of a full stop and a space, the practice faded out,
> even in Usenet, where fixed-pitch fonts are the norm (presumably because
> many people do more typing in word processors or other programs with
> proportional fonts than in fixed-pitch programs such as text editors and
> good Usenet clients).
>
> I've been using one space as a sentence separator for so long that I cannot
> now remember when I made the switch from two spaces.
>
> I'm trying to think up a way to link this to C, but not having a great deal
> of success.


You could write a filter program in standard C to adjust your posts so
that they use two spaces.
--
Flash Gordon
 
Reply With Quote
 
Army1987
Guest
Posts: n/a
 
      09-21-2007
On Thu, 20 Sep 2007 20:40:26 -0400, pete wrote:

> I like this better:
>
> printf("please key in any " xstr(LENGTH) " digits number :");

If you are indeed using printf, what's wrong with
printf("please key in any %d digits number :", (int)LENGTH)?
It'll continue to work if you define LENGTH in some more insane way.
--
Army1987 (Replace "NOSPAM" with "email")
If you're sending e-mail from a Windows machine, turn off Microsoft's
stupid “Smart Quotes” feature. This is so you'll avoid sprinkling garbage
characters through your mail. -- Eric S. Raymond and Rick Moen

 
Reply With Quote
 
Army1987
Guest
Posts: n/a
 
      09-21-2007
On Fri, 21 Sep 2007 08:32:56 +0100, Flash Gordon wrote:

>> I'm trying to think up a way to link this to C, but not having a great deal
>> of success.

>
> You could write a filter program in standard C to adjust your posts so
> that they use two spaces.


It is less trivial than it seems, Mr. Foo would receive two
spaces, too. (The solution could be using an extensive list of all
abbreviations such as Mr. etc. which can be followed by a capital
letter without starting a new sentence... But maybe there are
ambiguities, there, too?
And what about cases such as a proper name immediately followed by
ellipses? Ellipses are always three dots, they don't become four
when they end a sentence, usually the only way to tell if they do
is the case of the following letter...)

Anyway, a program written in C which uses ". " to tell where a
sentence finishes would be broken by using ". ".
--
Army1987 (Replace "NOSPAM" with "email")
If you're sending e-mail from a Windows machine, turn off Microsoft's
stupid “Smart Quotes” feature. This is so you'll avoid sprinkling garbage
characters through your mail. -- Eric S. Raymond and Rick Moen

 
Reply With Quote
 
Al Balmer
Guest
Posts: n/a
 
      09-21-2007
On Fri, 21 Sep 2007 00:52:23 +0000, Richard Heathfield
<(E-Mail Removed)> wrote:

>even in Usenet, where fixed-pitch fonts are the norm (presumably because
>many people do more typing in word processors or other programs with
>proportional fonts than in fixed-pitch programs such as text editors and
>good Usenet clients).


Since we're off-topic anyway, I wonder if this is actually true? I
read Usenet in a proportional font simply because I find it easier to
read. I switch to a fixed font when someone posts code, or underlines
an non-obvious part of the previous sentence. I consider my Usenet
client to be a good one. In fact, the ability to switch fonts is one
of its good features

--
Al Balmer
Sun City, AZ
 
Reply With Quote
 
Walter Roberson
Guest
Posts: n/a
 
      09-21-2007
In article <(E-Mail Removed)>,
Al Balmer <(E-Mail Removed)> wrote:
>On Fri, 21 Sep 2007 00:52:23 +0000, Richard Heathfield
><(E-Mail Removed)> wrote:
>
>>even in Usenet, where fixed-pitch fonts are the norm


>Since we're off-topic anyway, I wonder if this is actually true?


Who knows? Unless someone cares to do a statistical study of the
X-Newsreader headers of a large number of posts, and trusts that
the newsreaders are not lying about what program they are, and
the Newsreader name is correlated to ability to change fonts... then
the matter is essentially undecideable, potentially amenable only to
polls with bad "self-selection" bias.

And even if someone bothers to look up my X-Newsreader header and
notices that it cannot change fonts, they would miss the fact that I'm
almost always running the newsreader inside a terminal window and that
the terminal window can be configured to any font I want.

But if anyone cares: *I* only use fixed-width for reading Usenet.
I scan too many messages in which the formatting is important
(e.g., code) to make it worth flipping back and forth between
fonts.
--
If you lie to the compiler, it will get its revenge. -- Henry Spencer
 
Reply With Quote
 
Flash Gordon
Guest
Posts: n/a
 
      09-21-2007
Army1987 wrote, On 21/09/07 14:22:
> On Fri, 21 Sep 2007 08:32:56 +0100, Flash Gordon wrote:
>
>>> I'm trying to think up a way to link this to C, but not having a great deal
>>> of success.

>> You could write a filter program in standard C to adjust your posts so
>> that they use two spaces.

>
> It is less trivial than it seems, Mr. Foo would receive two


<snip difficulties>

I did not say that it was easy. Perhaps it would make good coursework
with extra marks being given for each of the difficulties the student
raises?

> Anyway, a program written in C which uses ". " to tell where a
> sentence finishes would be broken by using ". ".


I was not suggesting that a program should do that.
--
Flash Gordon
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      09-21-2007
Army1987 wrote:
> On Fri, 21 Sep 2007 08:32:56 +0100, Flash Gordon wrote:
>

.... snip ...
>
>> You could write a filter program in standard C to adjust your posts so
>> that they use two spaces.

>
> It is less trivial than it seems, Mr. Foo would receive two
> spaces, too. (The solution could be using an extensive list of all
> abbreviations such as Mr. etc. which can be followed by a capital
> letter without starting a new sentence... But maybe there are
> ambiguities, there, too?
> And what about cases such as a proper name immediately followed by
> ellipses? Ellipses are always three dots, they don't become four
> when they end a sentence, usually the only way to tell if they do
> is the case of the following letter...)
>
> Anyway, a program written in C which uses ". " to tell where a
> sentence finishes would be broken by using ". ".


Hey, I just wrote a sentence advising aslamhenny how to properly
punctuate English sentences; I didn't expect a major upheaval from
it. (And they don't end with ....).

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>



--
Posted via a free Usenet account from http://www.teranews.com

 
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
Wireless can get internet but can't see network -- can when wired 02befree Computer Support 0 12-24-2007 09:10 PM
SOLVED - can't open file in windows media player / WMP. But can in VLC - video LAN .. Now can in WMP jameshanley39@yahoo.co.uk Computer Information 2 09-19-2007 02:53 AM
Where can I find the help I need ? Can you help ? penang@catholic.org Computer Support 8 06-09-2007 02:55 PM
ReQ; Help having problem with cisco router 1602R the Lan part works cannot log on to configure so PC can access internet, router connects to T1 line thier is an alarm light on anyone can help smokin@aol.com Computer Support 4 10-30-2004 06:06 AM
Nothing can be found... HELP HELP HELP ... -=zZz=- Computer Support 15 02-29-2004 10:47 PM



Advertisments