Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_pre.php on line 387

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 337

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 339

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 341

Warning: Non-static method vBSEO_Storage::path() should not be called statically in ..../vbseo/includes/functions_vbseo_seo.php on line 343
Pointers

Results 1 to 8 of 8

Thread: Pointers

  1. #1
    Senior Member
    Join Date
    May 2007
    Posts
    104

    Pointers

    Hello, I have got a question about the pointers. Example: #include using namespace std; void main() { int a = 3; int &b = a; cout Wtf all I wrote is in one line????? In attachments is what I really wrote. I don't know what is wrong with this board?!?
    Attached Files Attached Files

  2. #2
    Coders muppetalert's Avatar
    Join Date
    Nov 2007
    Location
    Manchester, UK
    Posts
    1,005

    Re: Pointers

    Code:
    #include <iostream>
    
    using namespace std;
    
    void main() {
    	
    	int a = 3;
    	int &b = a;
    
    	cout<<b<<endl;
    	system("PAUSE");
    }
    What do you mean how would it look like with a pointer??
    whiteLight: ET, whiteLight: Quake Live (Formerly QLHook) and many other game hacks at http://whitelight.me.uk/

  3. #3
    Senior Member
    Join Date
    May 2007
    Posts
    104

    Re: Pointers

    Yes I can just get the adresse of an variable but not the value in it.

  4. #4
    Coders muppetalert's Avatar
    Join Date
    Nov 2007
    Location
    Manchester, UK
    Posts
    1,005

    Re: Pointers

    int *b = &a;
    whiteLight: ET, whiteLight: Quake Live (Formerly QLHook) and many other game hacks at http://whitelight.me.uk/

  5. #5
    Senior Member
    Join Date
    May 2007
    Posts
    104

    Re: Pointers

    Well thats exactly my problem :-). b points now at the adress of a but it wouldn't output the variable a....

  6. #6
    Coders muppetalert's Avatar
    Join Date
    Nov 2007
    Location
    Manchester, UK
    Posts
    1,005

    Re: Pointers

    Well,
    Code:
    #include <iostream>
    
    using namespace std;
    
    void main() {
    	
    	int a = 3;
    	int &b = a;
    
    	cout<<b<<endl;
    	system("PAUSE");
    }
    works fine (reference - This is not a pointer):
    Code:
    3
    Tryck ned valfri tangent för att fortsätta...
    Code:
    ...
    	int *b = &a;
    
    	cout<<b<<endl;
    ...
    gets the address, is that what you want?
    Code:
    0043FA74
    Tryck ned valfri tangent för att fortsätta...
    Code:
    ...
    	int *b = &a;
    
    	cout<<*b<<endl;
    ...
    works fine (pointer):
    Code:
    3
    Tryck ned valfri tangent för att fortsätta...
    I'm really not sure what you're trying to acheive.
    whiteLight: ET, whiteLight: Quake Live (Formerly QLHook) and many other game hacks at http://whitelight.me.uk/

  7. #7
    Senior Member
    Join Date
    May 2007
    Posts
    104

    Re: Pointers

    Nvm I've got it :-) Thank you muppertalert.

  8. #8
    Junior Member
    Join Date
    Aug 2008
    Posts
    1

    Re: Pointers

    Okey wat do u mean ^^

Similar Threads

  1. How to find pointers?
    By nathjr in forum Basics
    Replies: 1
    Last Post: March 20th, 2010, 22:37
  2. Cs 1.6 pointers`
    By insection in forum Counterstrike 1.6 Cheats
    Replies: 0
    Last Post: September 21st, 2009, 12:40
  3. [MASM] Bruting IDirect3D9 Pointers
    By Ksbunker in forum D3D
    Replies: 0
    Last Post: July 1st, 2009, 06:32
  4. Replies: 2
    Last Post: January 17th, 2009, 07:36
  5. [Help]Pointers
    By Zero in forum Basics
    Replies: 21
    Last Post: September 24th, 2007, 01:39

Bookmarks

Posting Permissions

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