3997


#include <stdlib.h>

#include <iostream>

using namespace std;

typedef unsigned short int USHORT;

int main()

{

using std::cout;

USHORT myAge; // zmienna

USHORT * pAge = 0; // wskaźnik

myAge = 5;

cout << "Program demonstruje użycie wskaźnika\n\n";

cout << "wskaznikowi pAge przypisuje adres zmiennej myAge\n";

cout << "myAge: " << myAge << "\n";

pAge = &myAge;

cout << "*pAge: " << *pAge << "\n\n";

cout << "Ustawiam *pAge = 7...\n";

*pAge = 7; // ustawia myAge na 7

cout << "*pAge: " << *pAge << "\n";

cout << "myAge: " << myAge << "\n\n";

cout << "Ustawiam myAge = 9...\n";

myAge = 9;

cout << "myAge: " << myAge << "\n";

cout << "*pAge: " << *pAge << "\n";

getchar();

return 0;

}

#include <stdlib.h>

#include <iostream>

using namespace std;

typedef unsigned short int USHORT;

int main()

{

using std::cout;

USHORT myAge; // zmienna

USHORT * pAge = 0; // wskaźnik

myAge = 5;

cout << "Program demonstruje użycie wskaźnika\n\n";

cout << "wskaznikowi pAge przypisuje adres zmiennej myAge\n";

cout << "myAge: " << myAge << "\n";

pAge = &myAge;

cout << "*pAge: " << *pAge << "\n\n";

cout << "Ustawiam *pAge = 7...\n";

*pAge = 7; // ustawia myAge na 7

cout << "*pAge: " << *pAge << "\n";

cout << "myAge: " << myAge << "\n\n";

cout << "Ustawiam myAge = 9...\n";

myAge = 9;

cout << "myAge: " << myAge << "\n";

cout << "*pAge: " << *pAge << "\n";

getchar();

return 0;

}



Wyszukiwarka

Podobne podstrony:
3997
3997
3997
3997
3997
3997
projekt walu poprawiony id 3997 Nieznany
3997
3997
3997

więcej podobnych podstron