| |

VerySource

 Forgot password?
 Register
Search
View: 1199|Reply: 11

Ask a simple VC pointer!

[Copy link]

3

Threads

13

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-10 07:40:02
| Show all posts |Read mode
char * a;
a = strstr (pBuffer3, temppoint);
for (int i ;; i ++)
...
...
int * j;
j =&a;

I want to assign the address value of the * a pointer to * j. I know that&means a reference. How can I get the address value of * a?
Reply

Use magic Report

0

Threads

57

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-11 18:09:02
| Show all posts
* a's address value?

That is not&(* a) = a
Reply

Use magic Report

0

Threads

57

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-11 18:27:01
| Show all posts
Of course&(* a) is not the correct way of writing, but in your opinion, the result is a
Reply

Use magic Report

3

Threads

13

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-1-11 20:00:02
| Show all posts
No, I mean I want to get the address value pointed to by pointer a in VC ++. Is there any way? I will report an error using "&"!
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-13 10:54:01
| Show all posts
Halo, the value of the address pointed by pointer a is not a, but the value of a
Reply

Use magic Report

3

Threads

13

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-1-13 12:27:01
| Show all posts
So how do I use the value of a to assign to other variables, and I want to assign the value of a to int j? ? ?
Reply

Use magic Report

3

Threads

13

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-1-15 19:00:01
| Show all posts
So if I get the address of a as an ASC code, is there any way to convert it to a character or an integer?
Reply

Use magic Report

0

Threads

57

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-16 09:54:01
| Show all posts
How could the address be ASCII?
Reply

Use magic Report

3

Threads

13

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

 Author| Post time: 2020-1-16 11:09:01
| Show all posts
Sorry, meaning that the value of a is an ACS code, converted to characters?
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-23 20:00:01
| Show all posts
The address stored in a is the address. To get the contents of the address, just add an *.
It is recommended that the landlord still read the book. This is very basic stuff.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list