Results 1 to 4 of 4

Thread: Pointers : I know a little more but...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    England
    Posts
    312

    Pointers : I know a little more but...

    right, now i know that something like...
    Code:
    int main()
    {
    char bugger[10] = "holy mofoe";
    char *cartrak="";
    
    cartrak=&bugger;
    
    cout<<cartrak;
    return 0;
    }
    will make something like

    holy mofoe

    whereas the dsame without the pointer would return

    h
    ..........
    i dont know if thats right exactly but i tihnk its along them lines, but then again, why is that a good thing, cause surely if i made cartrak a string with [10] init, it would return the same!

    can someone gimme another example plz, a REALLYT simple one and kinda put loads of comments in and what would happen withouyt the pointer
    Last edited by JafferAB; Jan 17th, 2002 at 02:53 AM.
    Power to 2000 Electronic Donkeys!
    www.edonkey2000.com
    I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    first off are you using c or c++, i can't make it out from your syntax printf<<
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Fanatic Member Wynd's Avatar
    Join Date
    Dec 2000
    Location
    In a bar frequented by colossal death robots
    Posts
    772
    LOL
    Alcohol & calculus don't mix.
    Never drink & derive.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    May 2001
    Location
    England
    Posts
    312
    c++, the code is fixed now
    Power to 2000 Electronic Donkeys!
    www.edonkey2000.com
    I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width