4. ,  ,  ...
This presentation is the property of its rightful owner.
Sponsored Links
1 / 22

Занятие № 4. Типы, определяемые пользователем, и указатели PowerPoint PPT Presentation


  • 80 Views
  • Uploaded on
  • Presentation posted in: General

Занятие № 4. Типы, определяемые пользователем, и указатели. Определение типа в C++ Для определения новых типов данных как псевдонимов существующих типов в C++ имеется ключевое слово typedef . Ключевое слово typedef Общий синтаксис использования typedef имеет вид

Download Presentation

Занятие № 4. Типы, определяемые пользователем, и указатели

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


4

4. , ,


4

C++

C++ typedef.

typedef

typedef

typedef;

typedef unsigned word;

typedef unsigned char byte;


4

typedef , . typedef , , , .


4

, , .

.


4

:

enum{< >};

enumYesNo { no, yes, dontCare, maybe };

enum weekday { Sunday, Monday, Tuesday,Wednesday, Thursday, Friday, Saturday } ;


4

:

enumCPUtype {i8088, i80286, i80386,i80486,80386};

C++ . , 0 i8088, 1 i80286 ..


4

C++ , .

, , .


4

:

struct

{

< >

};


4

struct point

{

double x;

double;

};

structcircle

{

point center;

double radius;

};


4

struct, . , , :

point p1, 2, 3;

:

structpoint

{

doublex;

double;

} p1, p2, p3;


4

() .


4

C++ , :

point pt = {1.0, -8.3);

-, :

pl.x = 12.45;

pl.y = 34.56;

2. = 23.4/pl.x;

2. = 0.98*pl.y;


4

C++ . , , . , .

, .


4

:

& ();

& = ;

, , . , .

int = 10, = 3;

int& rx(x);

int& ry = ; //


4

, , .

. , , C++, .

C++.


4

. , , , 0F63:01AF4.

. .

, .


4

intmyInt= 42;

int *pInt= &myInt;


4

:

* ;

* = ;

* = &;

& ( , &), . , , . . .


4

int* intPtr; // int

double* realPtr; // double

char* aString; // character

long lv;

long* lp = &lv;

, .

int *intPtr, anint;

double x, *realPtr;

char *aString, aKey;


4

, , *, .

, , * . .


  • Login