Hello,
I'm learning C++ & stuck at ->
May I see some simple examples of using -> please.
And anything more to know about ->
(Sorry if the question is unspecific)
Thanks.
A sinple example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#include <iostream>
int main()
{
struct A
{
int x;
int y;
};
A *pa = new A();
pa->x = 10;
pa->y = 20;
std::cout << "A::x = " << pa->x << ", A::y = " << pa->y << std::endl;
delete pa;
}
|
Last edited on