C++ pointerand references

hey guys anyone can explain the operation part of code clearly? I have an exam and i need to learn this asap

#include <iostream>
using namespace std;

> int main()
> {
>     int m = 44;
>     int* p = &m;
>     int& r = m;
>     int n = (*p++);
>     int* q = p - 1;  // Corrected the subtraction operator
>     r = *(--p) + 1;
>     ++*q;
> 
>     cout << "m is " << m << endl;
>     cout << "n is " << n << endl;
>     cout << "&m is " << &m << endl;
>     cout << "*p is " << *p << endl;
>     cout << "r is " << r << endl;
>     cout << "*q is " << *q << endl;
> 
>     return 0;
> }
> 

Blockquote

It might help if you give us more specifics on what exactly you don’t understand.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.