Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: pointer to ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 13 Topic 26086 of 26960
Post > Topic >>

Re: pointer to integer to pointer conversions

by lithiumcat@[EMAIL PROTECTED] May 6, 2008 at 08:33 AM

Thanks you all for your answers, they were really helpful. It seems
that 6.3.2.3 wasn't all.

Although it's quite off-topic, could you tell me what that
"ISO/IEC 1999:TC3" is worth? Can I take it as a reference? If so, is
there a similar reference for C89?

On May 6, 2:37 pm, Eric Sosman <esos...@[EMAIL PROTECTED]
> wrote:
>      Even in C89 you could printf a void* value with "%p".  You
> could also scanf it with "%p" (matching a void**), but the result
> was not usefully defined.  C99 (or maybe an intermediate revision)
> tightened the language to require that the round-trip must succeed
> if everything was valid to begin with, the program hasn't exited,
> the pointed-to location is still valid, and so on.

Thanks a lot for the idea, I haven't even considered it. I've
actually never used any scanf-like function. I don't like using
things I don't understand, and these functions looks a little bit
like magic to me. I will dig into that direction.

Now that I think about it, I made the mistake of only considering
giving the pointer to the user as an int, while actually I want to
give it as a printable string.

>      I can understand why you'd want to display pointer values as
> a debugging aid, but it seems peculiar to want to read them back
> again.  Chancy, too: An innocent typo arouses the nasal demons.

I don't know if it's a usual or good way to do it, but I like to
test parts of my programs "by hand", without any input santization
and as little processing as possible (I want to test the part of
my program, not the draft-input I put on it for testing/debugging
purpose). In these cases, an "innocent typo" only means that I
can't deduce anything from the test, which isn't that bad (though
I should probably consider myself lucky to encounter only program
segfaults as manifestations of undefined behaviour, and not e.g.
large-scale nuclear explosions).
 




 13 Posts in Topic:
pointer to integer to pointer conversions
lithiumcat@[EMAIL PROTECT  2008-05-06 05:05:39 
Re: pointer to integer to pointer conversions
vippstar@[EMAIL PROTECTED  2008-05-06 05:34:20 
Re: pointer to integer to pointer conversions
Eric Sosman <esosman@[  2008-05-06 08:37:09 
Re: pointer to integer to pointer conversions
rlb@[EMAIL PROTECTED] (R  2008-05-07 08:17:12 
Re: pointer to integer to pointer conversions
"Stephen Sprunk"  2008-05-07 16:37:01 
Re: pointer to integer to pointer conversions
Keith Thompson <kst-u@  2008-05-07 15:45:19 
Re: pointer to integer to pointer conversions
lithiumcat@[EMAIL PROTECT  2008-05-06 08:33:00 
Re: pointer to integer to pointer conversions
Keith Thompson <kst-u@  2008-05-06 12:46:11 
Re: pointer to integer to pointer conversions
Flash Gordon <spam@[EM  2008-05-06 21:42:38 
Re: pointer to integer to pointer conversions
vippstar@[EMAIL PROTECTED  2008-05-07 06:54:46 
Re: pointer to integer to pointer conversions
Peter Nilsson <airia@[  2008-05-07 15:30:26 
Re: pointer to integer to pointer conversions
rlb@[EMAIL PROTECTED] (R  2008-05-08 12:52:49 
Re: pointer to integer to pointer conversions
Peter Nilsson <airia@[  2008-05-07 15:44:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 16:37:34 CDT 2008.