Thread: help!!!!!! pointers homework

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    4

    help!!!!!! pointers homework

    can anyone solve the problems attached. i'm stuck and i don't know what to do and their due this monday. please!!!!!!

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675

  3. #3
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    I would suggest reading your book, concentrating on understanding what the syntax *ptr means. I would also suggest building a time machine to go back to October 9, 1998, because otherwise this homework is seriously overdue.

  4. #4
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    sigh sigh... "help", 6 exclamation marks, "homework", and a scan/paste.... sigh sigh

  5. #5
    Registered User
    Join Date
    Aug 2007
    Location
    U.K.
    Posts
    148
    You need to learn the difference between & and *. These state two different 'things' about the variable the pointer is pointing to.

    Once you spend a few minutes looking it up you'll get it no problem.

  6. #6
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    You get extra points today for being the boldest, most arrogant, cocky person to ever grace the board. Good job.

  7. #7
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Wait... this was due October 9? So is this like test review or something or what?

  8. #8
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    October 9, 1998 to be exact

  9. #9
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    "All statements are guaranteed to be syntactically valid C++"

    Maybe so, but what type is ptr2 here?
    double *ptr1, ptr2;
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  10. #10
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    1. 42
    2. &42
    3. sets ptr[42] = 24.9
    4. B
    5. A
    6. D
    7. T
    8. F
    9. T
    10. F
    11. T
    12. T
    13. F
    14. A - allocates a dynamic variable named pointer
    15. both

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Those who cannot complete their homework and turns to others to complete it for them deserves to fail.
    If, however, they come to others for guidance of help in completing or understanding their homework, then we heart-warmingly help.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    What does "the best possible answer" mean anyway?

    I mean, if an accurate answer is "x is 10", would "the answer is that x is assigned the value 10" be a better answer?
    And if so, what would be the best possible answer?

    Nice cursive script, with illumination on the first character perhaps?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  13. #13
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    those who demand we do their homework deserve the grade they get from my answers

  14. #14
    Registered User
    Join Date
    Nov 2008
    Posts
    4
    Quote Originally Posted by rags_to_riches View Post
    stupid

  15. #15
    Registered User
    Join Date
    Nov 2008
    Posts
    4

    Talking

    Quote Originally Posted by tabstop View Post
    I would suggest reading your book, concentrating on understanding what the syntax *ptr means. I would also suggest building a time machine to go back to October 9, 1998, because otherwise this homework is seriously overdue.
    yea mmm if i had a book i would have but hey a little bit of sarcasm is always good you actually made me laugh

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  2. 2D Array of Pointers
    By Slavakion in forum C++ Programming
    Replies: 12
    Last Post: 03-31-2004, 05:05 PM
  3. Passing pointers between functions
    By heygirls_uk in forum C Programming
    Replies: 5
    Last Post: 01-09-2004, 06:58 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM

Tags for this Thread