/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Development/languages/C/Core/modificators.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2009-04-09 03:21:08 UTC
  • Revision ID: csa@dside.dyndns.org-20090409032108-w4edamdh4adrgdu3
import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
1. extern <���>
 
2
    ���� � ������  *.o  ���� ���������� ����������, �� ��������� 
 
3
    extern <�� ���> ���� ����������� �� ������������ � ������� ��������� �����
 
4
 
 
5
2. static <���>
 
6
    * ��������, ��� ���������� ����� ����� static storage duration, �� ���� 
 
7
    int f() { static int i; i++ } -  � ������ ������� ������� i ����� ��
 
8
    ������� �������������.
 
9
    * ����� ���� static ���������� ������ ���������� �� ������� ����������
 
10
    ����� � ������� ������� extern.
 
11
    * static functions in pure C is invisible to other objects!   
 
12
    
 
13
   auto <���>
 
14
    �������� ( �� ��������� )
 
15
 
 
16
3. register <���>
 
17
    ���������� auto, �� � _��������_ ����� ��� ���������� �� ����������� 
 
18
    ������ � ���������, �.�. ��� ����� ������������.
 
19
 
 
20
4. mutable 
 
21
    ����������� � "class data member" ����������� ������ const ������������
 
22
    �� ����� ������. �� ����� ���� ��������� � static � const ������.
 
23
    
 
24
5. inline <func>
 
25
    ����������� ������� �� ����� ������ ������ ��������. ������ �� �����������
 
26
    � ������� �����������, ��� ��� ����������������.
 
27
    
 
28
6. const
 
29
    ������������� �� ������ ������
 
30
    const int *a; ��������� �� const int
 
31
    int *const a; const ��������� �� int
 
32
 
 
33
7. volatile
 
34
    ������������, ��� �� ������������� ����� ����. � ���������� �������
 
35
    ����������� ������������������ �������� ��� �������� ��������, ��
 
36
    �� ����� ���� ��� ������-�� ������. ( ������: �� ��������������! )
 
37
 
 
38
8. virtual ( ����������� ������� )
 
39
    * ���������� �� �������, ��� ��� ���� � ����������� ������ �� �������������,
 
40
    �� ������ �������� ��������� ������������ (override), �.�.
 
41
    A{ Caller(); virtual f() }
 
42
    B{ f() }
 
43
    A::Caller() { f(); }
 
44
    B *b -> ���������� f �� ������ B
 
45
    
 
46
    * ���� ����������� �����������, �� ����������� ������������
 
47
    * ������� ������� override �����������, � ����� ������� ����� �����������
 
48
    * ����������� ��� �� ����� ��������� ������������
 
49
    * ����� ���������� ����������� ������� - �����������
 
50
    * pure virtual function 
 
51
        virtual void A()=0; - �� ������� ����
 
52
        * ����� ���������� ����������� � �� ����� ��������
 
53
 
 
54
9. explict ( �������� �������� )
 
55
    class X {
 
56
        X(int);
 
57
        X(char *, int = 0) 
 
58
    }
 
59
    * ����� X a=1 ������������ X a=X(1); X a="hell" - ����� ������� ������������
 
60
    * ���� ����� ������������� ������� explict ( explict X(int) ), �� 
 
61
    ��������������� ( X a=1 ) ����� ���������.
 
62
    * � ������ explict: X a=X(1); X a(1); X a=(X)1; X a = static_cast<X>(1);