WWW.DISSERS.RU

    !


Pages:     | 1 |   ...   | 3 | 4 || 6 | 7 |   ...   | 18 |

Cmu npopaupoau. Xopo ce popapoa caecc a ca popa, p oopo oa ee ey cpyypy, eay ee ocyo oa. Ceye pepac c peeoo paee help C aca.

p e p o e c c o p, o o p, a p y C oo, o cxoa popaa, acaa a e C a opacpoaa epeeea coe a o a c pacpee *.exe, oa oa po epe p poecca:

pepoeccpoae, o apya.

1 B aay pepoeccopa xo oee p eoxooc ao popae ex ao, yaax p oo pe #include < aa c pacpee h > #include <" aa c pacpee">. pepoeccop ocae a eco x pe ec ao. Ec aa aeo < >, o oc aa pooc ceao paee, e xpac a c pacpee *.h ( peop INCLUDE). Ec aa aeo " ", o oc aa pooc caaa eye paee, a ae paee ocaoo. " aa" o ec popa, oope c eca ex y (o aao c oy aca).

He o o p e c a a p e a e e o e :

#include o-o;

#include paoa c oa;

#include aeaeca oea;

#include-paoa co cpoa;

#include-paoa c pepa;

#include-paoa c eepaopo cyax ce;

#include-paoa c pao;

#include-paoa c aeco a.

C oo pe #define, ce a oopo ec apo aee apo, apep, #define N 3 oo yaa pepoeccopy, o p o oe cxoo ae aoo e apo o ae o a cooecyee aee apo. aco apo coyc oo, o ya eaop eo aee.

Hapep, # define Pi 3.14. BC po ea apo ca c aao y.

2 oop a ecoo ao pacpye o, o paaae pepoeccop oe a c pacpee *.OBJ, coepa opoa a o, p yco, o e cpec cacece ceaece o. Ec cxoo ae C popa oapyac o, o popacy aec x cco.

3 apy cae ey coo oe a, oyae o oopa c popaa peyex oe ooo c py aa. B peyae cop oyaec a c pacpee *.EXE, oop oe cooa epcoa oepo.

T a x o oca, epeee cpyyp, coepae ca (ee eecee), ec (co cpo) apeca (epeex cpyyp).

o a oac opee ae, oope opaaac o pe oe popa.

Bce ax C oo pae a 2 aeop: cape cocae. pee a cpyypo cxee (pc. 10).

epeopeee a C coyec oepaop typedef.

puep:

typedef char str40[41];

typedef unsigned cher byte;.

CAPHE COCTABHE AATE APMET EPECE MACCB CTPT CMEC ECE P UNION H STRUCT & C ABAE EE ATO char float int double short long float long int...

signed unsigned Pc. 10 Cpyypa cxea o ax C B acae acac 4 ocox acca o ax:

1) poce ;

2) cpyyppoae ;

3) ccoe ;

4) poeype .

Cpyypa cxea peea a pc. 11.

Ha py c peopeee a acae oy cooac , aaaee popaco. Bce pye o oca paee oe. poce paec a opoe eecee. opoe paec a ee, oecee, coe, epecee, epae. opooe a ae aoy oopx cac cooecy opo oep. oy ae opooo a oo pe caapy y Ord (x), oopa opaae opo oep oo ae. oy ae opooo a oo pe caapy y Pred (x), oopa opaae aee, peecyee aaoy. oy ae opooo a oo pe caapy y Succ (x), oopa opaae aee, ceyee a aa.

T ax acae Integer, long (shot) int, ee oece True, false opoe Coe Char poce epece.

< a>=(cco) )000e) T aao < a>= min.. max Beecee <> = array[1..n,1..n,...] of...

Macc Cpyyppoac <> = record ae Moeca <> = set of a Var <>: <> <> = file of <> aae < yaae>=^ Cpo var < >:string < >:=procedure(function) (ea ):

poeype Oe Pc. 11 Cpyypa cxea o ax acae O E C T B A C A E ae oecoo a oy pa a ae: true and false. ae opeeec coooee:

false

Ord (false) = 0; {Opeeee ae opooo ea} Ord (true) = 1;

Succ (false) = true;

Succ (true) = false. {ocee aee opooo a} E P E C E M E T B A C A E epece opeeec oe aopo ae, oope yaac pyx coax.

T oec cey opao:

Type [Name] = (name1, name2, , namen), e [Name]- a, a namei ea epecex epeex.

Hanpuep:

Type Color = (Blue, Red, Green).

H T E P B A H E T B A C A E Bea epaoo a oe pa aee aaoa ae oo opooo a.

p oe oo a aac e oca, yaae epx pa aaoa oycx ae. Oe oca o paea ooy opooy y. o oec cey opao:

Type [Name] = [const1]..[const2].

Hanpuep:

Type Diapazon = 1... 10;

o po cooa p oex acco.

C T P T P P O B A H H E T A H H X o acc, ac, oeca, a. oo oo, ec ae ax a yaae, cpo, poeype ax oe.

Opeec a cox ooeo cocoa x cpyypa.

Ma c c B acae peypoy y ooc ooepy ooepy cooyoc cpoaoo ca oox eeo. p oe peypoo a aaec eo eeo, a ae eca o aoy eo epe. oyc a eca c ce opoe a cee LongInt.

oo cooa e epaoo a. O acc 100 eeo.

Type Data = array[1..100] of real;

Ec ee acca ae c acca, o peypyy cpyypy oo paccapa a acc, yee a ey paepoc. ac oe paa:

Array[Boolean] of Array [1..10] of Array[Size] of real Array[Boolean,1..10,Size] of Real;

e ac ae.

const N = 3;

type m = Array[1..N] of Real; {m o opeeee a ooep acc} var b : array[1..N] of m {b- o yep acc acc acca} i, j : iteger;

BC oe acca apax coax yaa acaoe oeco eeo acca.

Heoxoo o, o ee C yepyc c y.

puep:

# define N int mas [N], mass [N][N];

int i, j;

ec mas ooep acc, a mass yep acc.

C T P O O B C M B O H T ae cpoox o peca coo oceoaeoc coo epeeo . p oe cpoo e apax coax yaaec acaoe co aex e coo aaoe o 1 o 255.

Const ErrorMes: String[25] = Error;

var MyString: String [25];

A CMBO B STRING POHMEPOBAH, EPB MEET HOMEP 1. OM CMBO MO HO OPAATC, ABA EO OPOBHOMEP.

B acae 7.0 oc o ax cpo, aaae ye coo #0. B ax ax oo paec 65 535 coo. cpo xpac accax oc cey opao:

eaop cpoa:

Array[ aao,] of Char;

Hanpuep:

Var Zstr : Array[0..N] of Char;

pao c a cpoa eoxoo apoa pey oopa {$X+} {oepa pacpeoo cacca}.

BC cpo, o acc coo a char, anpuep:

char stroka [25].

M H O E C T B A B A C A E Moecma o aop oox oec cax py c pyo oeo. Xapaep ce ey oea opayeaec popaco a e opopyec acae.

Type [Name] = set of [base Type] ao e oe a word, integer, longint. ao e oe a oee 256 oox ae. aa oeca coyec ocpyop oeca cco cea eeo oeca.

Ha oeca opeee ceye oepa:

* epeceee oec; peya coep ee oe oox oec;

+ oeee oec; peya coep ee epoo oeca, ooe eoca eea opoo oeca;

paoc oec; peya coep ee 1-o oeca, oope e paea opoy;

= poepa aeoc opaae "cy", ec oeca ae;

<> poepa eaeoc opaae "cy" ec oeca eae;

<= poepa xoe epoo o opoe;

>= poepa xoe opoo oeca epoe;

in poepa paeoc eea I oecy S I in S.

poeyp Include (S,I) and Exclude (S,I) cooeceo a ca ee oeca (S oeco; I ee).

puep: Type DigitChar = Set of 0..9;

Var S1, S2, S3 : DigitChar;

Begin S1:= [1,2,3];

S2:= [3,1,4]; {ocpyop oeca} S3:= [2,5];

if '1' in S2 then Writeln ('ee 1 pae oecy S2');

end;

Cco cea eeo oeca, oeex py o pya a, opae apae co, aa ocpyopo oeca.

A O B E T A C A ao pecae coo ey oceoaeoc ooeo ace, oope oy paea oy y, a cee aooo oo pyoo, coepaeo ao.

Type [Name] = file of [Type].

ao epeey aooo a oo aa o pex cocoo:

[Name] = File of[Type]; poa a;

[Name] = Text; eco a;

[Name] = File; epoa a, ec [Name] aooo a (eaop); File of apeeppoae coa (a ); Text caapoo a ecox ao; [Type] o , poe aooo. oee opoo o aax paee ao o-o.

C T P T P B OTE OT MACCBOB, BCE EMEHT OTOPX OH T OHOO TA, CTPTP OEHT B OHO EPEMEHHO EMEHT PAHX TOB.

Cpyyp ocpypyc cey opao:

Struct _cpyyp {_1 oe_1;

_2 oe_2;

_n oe_n;

};

Ocae epeeo cpyypoo a cey opao:

Struct struct_name x,y,z.

Cpyyp epee oo pcaa aee apeao (cpay ce cpyype), o x e cpaa a paeco epaeco. cpae cpyyp ceye ca ceapoae y, ace o poe. cpyype oo pe oepa & (oyee apeca) ce ee apeca.

&struct_name.

o cpyyp oo opaac, yaa epeeo, o pae ea oo.

Hapep:

Type_1 value1 = x.field_1;

Type_3 value3 = z.field_3;

Ec epeea ptr opeeea a yaae a cpyypy, o ocya o cpyyp oo cooa oepa "" eco " *ptr ".

Hanpuep:

Struct struct_name *ptr;

Type_1 value1 = ptrfield_1;

Type_2 value2 = ptrfield_2;

Oepaop ptrfield_1aee pae (*ptr).field_1.

Bex cyax, oa oycaec cooa yapy oepa & oye apeca cpyyp eo, oo y e oepa cooa oye apeca ooea cpyyp.

Ha ce cocex oe cpyyp -a eoxooc paa pa a o ae ee oy oa p, yco. Booee yco oe pec apye ooc popa, caaey p epexoe o oo peaa C pyo.

p oe cce Turbo-C eoxoo yaa a, oa oop oe paa cpyyp ( oee) o pae coa, oa cpyype ooee a.

aae a a apapye ceyee:

1 Cpyypa ye aac c pa coa (e apec).

2 aoe e cooe oe ye aac co co a eoe co ao o aaa cpyyp.

3 B oe cpyyp ye (o eoxooc) oae o a, c e o c cpyypa coepaa eoe co ao.

-a-cpyyp o eaop, oop eye cpyyp, opeee cco oe eeo.

Ocae eye epeey cpyypoo a. B aece ocae oe epeeo, opoao yaae, acc y.

aae paccapaec a yaae a cpyypy, acc a acc cpyyp, a y a y, opaaa cpyypy.

Cco-oe-eeo coep oo ecoo oe epeex oe o.

aa epeea, oea o cce, aaec eeo cpyypoo a. O oy oo ocooo a, acco, yaaee, cec cpyypo.

puep:

Struct teacher { Char name[40];

Int number;

Float salary;} list [20], *ptr;

Struct teacher_ school ();

Bo pepe oec acc cpyypoo a teacher 20 eeo, yaae a cpyypy a teacher y, opaaa cpyypy a teacher.

Cpyypa e oe coepa aece eea cpyypy aoo e a, o oe a yaae a cpyypy oo a p yco, o oe cpyyp yaao a. o ooe coaa ce cc cpyyp.

Hanpuep:

Struct tree {int number;

struct tree* left;

struct tree* right;

};

B acae ae oo a po aa ac.

A C ac o cpyypa ax, cocoa cpoaoo ca ooeo, aaex o ac. B oe o acca, ooe (o) ac oy paoo a. o oo o ccac a o o ooe ac, o ac eyc.

Cpyypa oe a ac ee :

[ a] = record [cco oe] end, e [ a] eaop, record, end apeeppoae coa (ac, oe), [cco oe]- cco oe, pecae coo oceoaeoc paeo ac, ey oop cac oa c ao.

a pae coco ooo ecox eaopo oe, oeex py o pya a. a eaopa cac oeoe ec o, apep:

Type BirthDay = record Day, Month, Year:Word end;

var a,b : BirthDay;

Bo pepe BirthDay (e poe) ec ac c o Day, Month, Year (e, ec o); epeee a,b coepa ac a BirthDay.

ae epeex a ac oo pcaa py epee oo e a, apep:

a:= b;.

aoy ooeo ac oo oy ocy, ec cooa cocaoe , yaa epeeo epe oy o:

a.day:= 12;

b.year:= 1965;.

oex oe eoxoo pooa yoe:

Type BirthDay = record Day, Month, Year:Word end;

var p: record Name:String;

Bd : BirthDay end;

begin if p.Bd.Year = 1965 then end;

ea oe ac o ya, peeax o ac, e o oe, oao, ec ac coepa o-ac, o ea oy oopc a pax ypox (a. 5).

Pages:     | 1 |   ...   | 3 | 4 || 6 | 7 |   ...   | 18 |






















2011 www.dissers.ru -

, .
, , , , 1-2 .