Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > C doubt

Reply
Thread Tools

C doubt

 
 
sangeeta chowdhary
Guest
Posts: n/a
 
      07-02-2010
format of printf is -
int printf(const char *format, ...)

Can anyone tell me how printf(5 + "Fascimile\n") displaying
mile.How this statement working?
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      07-02-2010
On 07/ 2/10 05:17 PM, sangeeta chowdhary wrote:
> format of printf is -
> int printf(const char *format, ...)
>
> Can anyone tell me how printf(5 + "Fascimile\n") displaying
> mile.How this statement working?


Question is more appropriate then doubt in this context.

"Fascimile\n" is a string literal with an address. printf is being
called with the address + 5, which will be the sixth character, 'm'.

It may be easier to understand if it's rewritten:

const char *format = "Fascimile\n";

printf( format+5 );

--
Ian Collins
 
Reply With Quote
 
 
 
 
Francois Grieu
Guest
Posts: n/a
 
      07-02-2010
On 02/07/2010 07:17, sangeeta chowdhary wrote:
> format of printf is -
> int printf(const char *format, ...)
>
> Can anyone tell me how printf(5 + "Fascimile\n") displaying
> mile. How this statement working?


Think of "Fascimile\n" as a pointer to a number of chars, and
5 + "Fascimile\n" as a pointer 5 characters past the start of
that number of chars. Now from the standpoint of printf,
things are much as for printf("mile\n").
Thus printf parses "mile\n" and as part of its normal behavior,
copies to standard output any char that it finds before the end
of that string (or a '%' which does not occur and would trigger
special behavior); hence mile is displayed.

Francois Grieu
 
Reply With Quote
 
blmblm@myrealbox.com
Guest
Posts: n/a
 
      07-02-2010
In article <>,
Ian Collins <ian-> wrote:
> On 07/ 2/10 05:17 PM, sangeeta chowdhary wrote:
> > format of printf is -
> > int printf(const char *format, ...)
> >
> > Can anyone tell me how printf(5 + "Fascimile\n") displaying
> > mile.How this statement working?

>
> Question is more appropriate then doubt in this context.


In your usage, apparently, and also in mine, but I'm told that in
the variety of English spoken in India, "doubt" is used in contexts
where you or I would use "question".

Just sayin', maybe.

[ snip ]

--
B. L. Massingill
ObDisclaimer: I don't speak for my employers; they return the favor.
 
Reply With Quote
 
Stephen Sprunk
Guest
Posts: n/a
 
      07-02-2010
On 02 Jul 2010 10:56, Kenneth Brody wrote:
> On 7/2/2010 1:30 AM, Ian Collins wrote:
>> Question is more appropriate then doubt in this context.

>
> This has come up several times in the past in CLC. Apparently, in the
> English dialect spoken on the Indian subcontinent, this usage of "doubt"
> is correct.


Translation: Indian schools teach their students to use "doubt" when
they should be teaching them to use "question".

While the verbs "question" and "doubt" are almost interchangeable, the
nouns "question" and "doubt" are not; they are distinct concepts (the
former is a request for information, the latter is an expression of
disbelief). If the issue is that there is only one word in the local
language(s) for all meanings, and they wish to teach only one word as
the "correct" translation, it should "question" since that is more
likely to be correct in reality.

I have three other complaints about this particular Subject line:

1. This is comp.lang.c, and posts about anything other than C are
off-topic, so readers can assume (unless marked otherwise) that the post
is about C; explicitly mentioning it in the Subject line is superfluous.
2. If the poster has a question, that is better indicated with a
question mark than the word "question" (or "doubt").
3. Nearly all new threads are started by a question, so indicating one
has a question in the Subject line is also superfluous.

Hence, the Subject line "C doubt" is not only incorrect, it is also void
of useful content. The poster might as well leave it blank and save a
few bits.

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking
 
Reply With Quote
 
Richard Bos
Guest
Posts: n/a
 
      07-04-2010
<> wrote:

> Ian Collins <ian-> wrote:
> > On 07/ 2/10 05:17 PM, sangeeta chowdhary wrote:
> > > Can anyone tell me how printf(5 + "Fascimile\n") displaying
> > > mile.How this statement working?

> >
> > Question is more appropriate then doubt in this context.

>
> In your usage, apparently, and also in mine, but I'm told that in
> the variety of English spoken in India, "doubt" is used in contexts
> where you or I would use "question".


Yah. And in the variety of English spoken in Germany, "handy" is a
mobile phone.

Neither is _English_. Neither should be used in an international
context.

Richard
 
Reply With Quote
 
Anand Hariharan
Guest
Posts: n/a
 
      07-07-2010
On Jul 2, 1:27*pm, Stephen Sprunk <step...@sprunk.org> wrote:
> On 02 Jul 2010 10:56, Kenneth Brody wrote:
>
> > On 7/2/2010 1:30 AM, Ian Collins wrote:
> >> Question is more appropriate then doubt in this context.

>
> > This has come up several times in the past in CLC. *Apparently, in the
> > English dialect spoken on the Indian subcontinent, this usage of "doubt"
> > is correct.

>
> Translation:


You mean 'Paraphrase'. Kenneth and you both wrote in English. You
did no translation.


> Indian schools teach their students to use "doubt"


No, they do not.


> when
> they should be teaching them to use "question".
>


You are not setting Indian education policy. Your opinion is
irrelevant.


> While the verbs "question" and "doubt" are almost interchangeable, the
> nouns "question" and "doubt" are not; they are distinct concepts (the
> former is a request for information, the latter is an expression of
> disbelief). *If the issue is that there is only one word in the local
> language(s) for all meanings, and they wish to teach only one word as
> the "correct" translation, it should "question" since that is more
> likely to be correct in reality.
>


Doesn't hurt to get your grammar correct when you are being
sanctimonious about correct English.


(...)
> Hence, the Subject line "C doubt" is not only incorrect, it is also void
> of useful content.


Agree that it is void of useful content.


> *The poster might as well leave it blank and save a
> few bits.
>


Terrible advice.

- Anand
 
Reply With Quote
 
Anand Hariharan
Guest
Posts: n/a
 
      07-07-2010
On Jul 2, 1:26*pm, Richard Heathfield <r...@see.sig.invalid> wrote:
(...)
> It's generally a good plan, when visiting any kind of discussion group
> seeking help, to minimise the number of reasons for people not to help
> you. It is, for example, wise for people asking in comp.lang.c to use
> the word "question" when that is appropriate, rather than "doubt". For
> the same reason, people seeking help on a forum or newsgroup
> predominantly frequented by those living in India would do better to use
> "doubt" rather than "question".
>
> When in Barcelona, do as the Barcelonianianians do.
>


Notwithstanding that I find Sangeeta's choice of the subject quite bad
myself, and that you explained pre and post increment to her at some
length, I find it extremely silly that one would not help just because
"doubt" was used in place of "question" -- especially when it has been
established that they are considered equivalent in certain dialects of
the English language. Where does it end? Why not insist 'favor' and
'criticize' are misspelt and refuse to help?

- Anand

Comparing Usenet newsgroups to geographical transcend national
boundaries.
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      07-07-2010
Anand Hariharan <> writes:
> On Jul 2, 1:26Â*pm, Richard Heathfield <r...@see.sig.invalid> wrote:
> (...)
>> It's generally a good plan, when visiting any kind of discussion group
>> seeking help, to minimise the number of reasons for people not to help
>> you. It is, for example, wise for people asking in comp.lang.c to use
>> the word "question" when that is appropriate, rather than "doubt". For
>> the same reason, people seeking help on a forum or newsgroup
>> predominantly frequented by those living in India would do better to use
>> "doubt" rather than "question".
>>
>> When in Barcelona, do as the Barcelonianianians do.
>>

>
> Notwithstanding that I find Sangeeta's choice of the subject quite bad
> myself, and that you explained pre and post increment to her at some
> length, I find it extremely silly that one would not help just because
> "doubt" was used in place of "question" -- especially when it has been
> established that they are considered equivalent in certain dialects of
> the English language. Where does it end? Why not insist 'favor' and
> 'criticize' are misspelt and refuse to help?


Who said anything about not helping? The question was answered,
wasn't it? Richard didn't do so in the followup you're quoting
because others had already done so.

--
Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Alan Curry
Guest
Posts: n/a
 
      07-07-2010
In article <e94836e3-99d5-44fa-9bba->,
Anand Hariharan <> wrote:
>Notwithstanding that I find Sangeeta's choice of the subject quite bad
>myself, and that you explained pre and post increment to her at some
>length, I find it extremely silly that one would not help just because
>"doubt" was used in place of "question" -- especially when it has been
>established that they are considered equivalent in certain dialects of
>the English language. Where does it end? Why not insist 'favor' and
>'criticize' are misspelt and refuse to help?


Add me to the list of people opposing this odd drift in the usage of the
word "doubt". I can't judge how standard it might be when used among
Indians, but when it escapes the subcontinent, it's jarringly wrong. In
the rest of the world, that word doesn't mean what you're using it to
mean, and readers are left guessing until they have seen it enough times
to figure out the pattern and mentally make the appropriate correction.

--
Alan Curry
 
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
dotnet doubt can any body clarify my doubt challa462@gmail.com ASP .Net 0 08-22-2012 06:02 AM
doubt about doubt Bob Nelson C Programming 11 07-30-2006 08:17 PM
doubt Ajith Nair ASP .Net 6 03-29-2005 01:25 PM
doubt about namespace google manasa sreenivas via .NET 247 ASP .Net 1 05-15-2004 03:05 PM
Doubt to go .Net technology Igbal ASP .Net 1 11-17-2003 06:56 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