Exam question help

This is a discussion on Exam question help within the C Programming forums, part of the General Programming Boards category; Originally Posted by Overworked_PhD You are the one that stated I was wrong. So now I'm asking you to prove ...

  1. #76
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by Overworked_PhD View Post
    You are the one that stated I was wrong. So now I'm asking you to prove it. God. Not only are you annoying, but quite frankly, you aren't that bright.
    Uhh.. yeah I said you were wrong in that, you said a pointer does not point to an address. Also, I you commented on one of my posts not the other way around, so you need to prove me you are right, which of course you are not. So run back to daddy and get your ass wiped by the usenet boys who actually know what they are talking about Chad. Also, stop drinking!!!
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  2. #77
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Just to be clear, I was not disagreeing with K&R.

    But here's the closest thing I found to "the definition of a pointer" in the c99 draft standard:
    539 — A pointer type may be derived from a function type, an object type, or an incomplete type, called the referenced type.

    540 A pointer type describes an object whose value provides a reference to an entity of the referenced type.

    541 A pointer type derived from the referenced type T is sometimes called “pointer to T”.
    from
    http://c0x.coding-guidelines.com/index.html
    sec 6.2.5 Types

    Because the standard does not deal with it's own implementation, I think the language (of the standard) does not permit a definitions such as "contains an address of". Technically, a compiler could do this however it wants -- it could release passenger pigeons and upon their return provide "a reference to an entity of the referenced type".

    Still, methinks this most likely a memory address...hence, it would be hard to prove "contains an address of" false (the standard doesn't).
    Last edited by MK27; 05-01-2010 at 07:20 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  3. #78
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,706
    Quote Originally Posted by Overworked_PhD View Post
    You are the one that stated I was wrong. So now I'm asking you to prove it. God. Not only are you annoying, but quite frankly, you aren't that bright.
    Quote Originally Posted by claudiu View Post
    I am not going to provide any evidence to my claims because I will get you into a bad habit of asking for evidence for VERY OBVIOUS THINGS like why 1+1 equals 2 in base 10. So why don't you prove me wrong instead? Give me a pointer that doesn't hold an address and I will believe you. Until then, you remain the same impotent C programmer I've known.
    I interpreted that to mean that you are the one making the extraordinary claim that pointers do not have to store addresses. Well do you know what they store instead? Perhaps I've misunderstood, but I hope this isn't some semantic distinction between memory locations and object offsets, or something. TBH I'm not even sure if that distinction is real. Memory is frequently the only resource that matters.

  4. #79
    Banned
    Join Date
    May 2007
    Location
    Berkeley, CA
    Posts
    329
    Quote Originally Posted by claudiu View Post
    Uhh.. yeah I said you were wrong in that, you said a pointer does not point to an address. Also, I you commented on one of my posts not the other way around, so you need to prove me you are right, which of course you are not. So run back to daddy and get your ass wiped by the usenet boys who actually know what they are talking about Chad. Also, stop drinking!!!
    Again, quit side stepping the issue and cite the exact ANSI/ISO C passages that explicitly state that a pointer must hold an address. I mean, if you are going to say I'm wrong, at least have the proof. Otherwise just shut up and go take care of your snot nosed punk kids. I mean, you seem to spend more time on here than with them. At this rate, they will probably end up doing drugs because "dad was never around."

  5. #80
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by whiteflags View Post
    I interpreted that to mean that you are the one making the extraordinary claim that pointers do not have to store addresses. Well do you know what they store instead? Perhaps I've misunderstood, but I hope this isn't some semantic distinction between memory locations and object offsets, or something. TBH I'm not even sure if that distinction is real. Memory is frequently the only resource that matters.
    Well, I think the best way to get an impression over how this started is to go back to page 2 of this thread and read on from there. Make sure you grab some popcorn .
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  6. #81
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by Overworked_PhD View Post
    Again, quit side stepping the issue and cite the exact ANSI/ISO C passages that explicitly state that a pointer must hold an address. I mean, if you are going to say I'm wrong, at least have the proof. Otherwise just shut up and go take care of your snot nosed punk kids. I mean, you seem to spend more time on here than with them. At this rate, they will probably end up doing drugs because "dad was never around."
    Lol... you mean like you ended up? Nah.. my kids are doing great, actually my eldest son is just learning C, if you want I can arrange for him to teach you a few things.
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  7. #82
    Banned
    Join Date
    May 2007
    Location
    Berkeley, CA
    Posts
    329
    Quote Originally Posted by whiteflags View Post
    I interpreted that to mean that you are the one making the extraordinary claim that pointers do not have to store addresses. Well do you know what they store instead? Perhaps I've misunderstood, but I hope this isn't some semantic distinction between memory locations and object offsets, or something. TBH I'm not even sure if that distinction is real. Memory is frequently the only resource that matters.
    Some of the SUN Machines at Kodak use an offset, and not an address, when it comes to stuff like indexing arrays.

  8. #83
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by Overworked_PhD View Post
    Again, quit side stepping the issue and cite the exact ANSI/ISO C passages that explicitly state that a pointer must hold an address.
    Cite the exact usenet post, and the credentials of the poster, and the ANSI/ISO C passages that explicitly state that a pointer doesn't hold an address. Since you are the one claiming it does not, prove it. Also, prove what it does in fact hold, if it does not in fact hold an address.

    While you're at it, grab a dictionary, and look up the word address to understand its meaning.


    Quzah.
    Hope is the first step on the road to disappointment.

  9. #84
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by Overworked_PhD View Post
    Some of the SUN Machines at Kodak use an offset, and not an address, when it comes to stuff like indexing arrays.
    Again the Kodak standard. ROFL
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  10. #85
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by claudiu View Post
    Make sure you grab some popcorn .
    <giggle> <burp>
    Attached Images Attached Images  
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  11. #86
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by Overworked_PhD View Post
    Some of the SUN Machines at Kodak use an offset, and not an address, when it comes to stuff like indexing arrays.
    Prove it.


    Quzah.
    Hope is the first step on the road to disappointment.

  12. #87
    Banned
    Join Date
    May 2007
    Location
    Berkeley, CA
    Posts
    329
    Quote Originally Posted by claudiu View Post
    Again the Kodak standard. ROFL
    No, it's a standard SUN Machine with a conforming C compiler. It would only be a Kodak standard if the company had modified the compiler.

  13. #88
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by Overworked_PhD View Post
    No, it's a standard SUN Machine with a conforming C compiler. It would only be a Kodak standard if the company had modified the compiler.
    I know man. Are you that pathetic that you don't realize everyone is just making fun of you here?
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  14. #89
    Banned
    Join Date
    May 2007
    Location
    Berkeley, CA
    Posts
    329
    Quote Originally Posted by claudiu View Post
    I know man. Are you that pathetic that you don't realize everyone is just making fun of you here?
    Yes, because it's totally obvious that both MK27 and whitefang has sided with you.

  15. #90
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by Overworked_PhD View Post
    Yes, because it's totally obvious that both MK27 and whitefang has sided with you.
    Lol they haven't sided with anyone. They are just sane, unlike you madman!
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

Page 6 of 8 FirstFirst 12345678 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 12:14 PM
  2. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 08:22 PM
  3. sort problem for an exam
    By rjeff1804 in forum C Programming
    Replies: 10
    Last Post: 02-12-2003, 09:33 PM
  4. another exam question
    By rjeff1804 in forum C Programming
    Replies: 4
    Last Post: 02-12-2003, 09:29 PM
  5. The AP Exam.....
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 32
    Last Post: 02-10-2003, 08:46 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21