Documente Academic
Documente Profesional
Documente Cultură
Variabilele
sunt pointeri de tip intreg. Scrieti programul si realizati corespondenta adreselor
date in sistemul de numeratie zecimal cu adresele date de program in sistemul
de numeratie hexazecimal.
Pe cati octeti se scriu variabilele?
De ce ne afiseaza valori diferite pentru aceiasi variabila?
b
***x
a
*y
z
*z
**y
*x
2293484
**x
2293488
2293492
2293496
2293500
adresele variabilelor
(&*)*x = &*y
*y =z
&*y = &z
**x = z
*x = &z;
b
*y
*x = y
2
2293484
x = &y
y = &z
**x = &b
a
**y
&*x =&y
*(&z) =&b
y
z = &b ;
x
rezulta:
*x
**x
22934
84
***x
*z
229348
4
2293488
2293492
2293496
2293500
23 August 2014
Profesor Vasilescu
Dumitru
#include <iostream>
using namespace std;
int main()
{
cout << "Starting..." << endl;
int ***x ;
int **y ;
int *z ;
int a = 1, b = 2 ;
z = &a ;
y = &z ;
x = &y ;
cout<< **y<< endl ; //afiseaza 1
**x = &b ;
cout<< **y <<endl ;
//afiseaza 2
22fef8;
22fef4;
22feec;
22fef4;
22feec;
cout<<z<<"; "<<*z<<endl;
//22feec;
22fefc
return 0;
}
22fef8
22fef4
22fef0
22feec