Thread: Help needed

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    30

    Unhappy Help needed

    I'm having problems understanding pointers in C. Can someone help me please. i really need your help. got exams in a few days.


  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Browse this thread from a few days ago.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Registered User
    Join Date
    Jul 2003
    Posts
    30
    Thanks a lot. i got so much problems with pointers and arrays. i tried a lot to learn about them but to no avail. hope i'll understand them now.

  5. #5
    Registered User
    Join Date
    Jul 2003
    Posts
    30
    got any idea how to understand it quickly n in a simple manner. Thanks

  6. #6
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164
    Try explaining what you do understand and what is giving you problems. We will help you understand if we can, but we can't teach from scratch.
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

  7. #7
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    A pointer is something that "points" at another variable. What it's doing is storing the memory address of that other variable, and then by using that, the other variable can be found, read, modified, whatever. It might not seem useful, but they're the sine qua non of cool stuff in C/C++.
    Away.

  8. #8
    Registered User
    Join Date
    Jul 2003
    Posts
    30
    Thx. i get problem with stuffs like **p=&a
    ++*arr
    *++arr
    ++**arr+--arr[1][1]

    *t++=*s++

    stuffs like this.

    thx

  9. #9
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    **p=&a
    A pointer to a pointer to a pointer, dereferenced twice (giving you a pointer), being assigned the address of a variable.

    ++*arr
    The pointer is dereferenced, and that value is incremented. This changes what is pointed at.

    *++arr
    Dereference a pointer. Increment the pointer. This does not effect the dereferenced variable. It simply gives you the contents of the variable, then it increments the pointer.

    ++**arr+--arr[1][1]
    Horrible.
    Dereference a pointer to a pointer, increment it (what's there), add to it the decremented value in a two dimensional array. Something like that. (Doing two things at once.)

    *t++=*s++
    Dereference two variables, make t hold whatever s is at said spot, then increment both pointers.

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

  10. #10
    Registered User
    Join Date
    Jul 2003
    Posts
    30
    Thx. i'm really grateful to all of u guys who've taken the time to help me. i hope one day i'll be able to help others too like you just did. if i do get more problems, i know where i can get help. it makes me feel better to know there are pple willing to help me. thx a lot

  11. #11
    Registered User
    Join Date
    Jul 2003
    Posts
    30
    Btw, i've noticed some of u have really cute avatars.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. free needed or not?
    By quantt in forum Linux Programming
    Replies: 3
    Last Post: 06-25-2009, 09:32 AM
  2. C Programmers needed for Direct Hire positions
    By canefan in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 09-24-2008, 11:55 AM
  3. lock needed in this scenario?
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 05-25-2008, 07:22 AM
  4. C++ help needed
    By Enkindu in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 08-31-2004, 11:24 PM
  5. semi-colon - where is it needed
    By kes103 in forum C++ Programming
    Replies: 8
    Last Post: 09-12-2003, 05:24 PM