3GL   4GL   5GL   .

-

- ++

++, , , - . , , , - : , .

++ - . , , . ++ . "" , "" . ++ , .

, , , .

++
#include "stdio.h"
int i;
char temp[80], buff[80];

printf (" :");
gets(temp); i = atoi(temp);
printf (" :");
gets (buff);
printf (" : %d\n", i);
printf (" : %s\n", buff);

#include "iostream.h"
int i;
char buff[80];

cout << " :";
cin >> i;
cout << " :";
cin >> buff;
cout << " :" << i << "\n";
cout << " :" << buff << "\n";

- ++. cin - , , cout - , . cin cout, , (), (), iostream ().

++

++ - - printf() scanf() , ++ , . ++ / << >>, . ( ), << >> .

cout << ;

++.

( scanf()).

,

int i;
cin >> i;

, i &. , >>:

cin >> ;

/ ++, iostream.h.

++ . . , .

.

class _
{
 
public:
 
};

?

  1. _ , .
  2. , , . , , . - .
  3. , , , (private) . .. . public. , public, , , . . , .

struct _3d
{
 double mod ();
 double projection (_3d r);
private:
 double x, y, z;
};

class _3d
{
 double x, y, z;
public:
 double mod ();
 double projection (_3d r);
};

++ class. , , . struct , , , .

mod() projection(_3d r) _3d, . , , , . . .

double _3d::mod ()
{
 return sqrt (x*x + y*y +z*z);
}

double _3d::projection (_3d r)
{
 return (x*r.x + y*r.y + z*r.z) / mod();
}

...

main()
{
 _3d a, b;
 double dPro, dMod;
 dMod = a.mod();
 dPro = b.projection(a);
}

(overload)

++ - .

, , , ++ , .

double power (double x) {return x*x;}
int power (int x) {return x*x;}

, , : abs(), labs() fabs() , , , . - , (.. ), . ++ "" .

int abs (int x) { return x<0 ? -x:x; }  // 1
long abs (long x) { return x<0 ? -x:x; } // 2
double abs (double x) { return x<0 ? -x:x; } // 3

main()
{
cout << " -1000" << abs(-1000) << "\n";   // 1
cout << " -1000L" << abs(-1000L) << "\n";   // 2
cout << " -1000.0" << abs(-1000.0) << "\n";   // 3
}

++ , overload. .

, " , ".

. , . . . , , . .

: .

, - , , . :

int i1, i2, i3;
long int l1, l2, l3;
double f1, f2, f3;
i1 = i2 + i3;
l1 = l2 + l3;
f1 = f2 + f3;

"+". ( , ). , , . , "+" ( ) .

. BASIC "+". , "+", , , .

++ , - , , ++ , .

. ( ) operator , . . - .

struct _3d
{
 double x, y, z; //
 _3d operator + (_3d);
};
_3d _3d::operator + (_3d b)
{
 _3d c;
 c.x = x + b.x;
 c.y = y + b.y;
 c.z = z + b.z;
 return c;
}

(). () . - ".".

:

_3d A, B, C;
A.x = 1.0;
A.y = 1.0;
A.x = 1.0;
B = A;
C = A + B; // C = A.operator + (B); /operator +(...) A/

:

. , , , . (, ). , , , "+" , 18 "". , .

++. . , , .

, .

,

void f (int i=0, int j=1); // f (...)
...
void f (int i, int j)
{
... //
}

f (); // i 0, j 1
f (10); // i 10, j 1
f (11, 22); // i 11, j 22

j, i , . , , .

. .

. , , , , , . , , , .

        3GL   4GL   5GL   .

, , - . , , . , .




 21.01.2021 - 17:54: - Economy and Finances -> - _.
21.01.2021 - 08:17: , , - Upbringing, Inlightening, Education -> - _.
21.01.2021 - 07:59: , , - Upbringing, Inlightening, Education -> - _.
20.01.2021 - 17:39: , , - Upbringing, Inlightening, Education -> - _.
19.01.2021 - 12:55: - Conscience -> . ? - _.
18.01.2021 - 11:33: - Personalias -> WHO IS WHO - - _.
18.01.2021 - 09:05: , - War, Politics and Science -> . - _.
18.01.2021 - 08:21: , , - Upbringing, Inlightening, Education -> - _.
17.01.2021 - 17:59: , - War, Politics and Science -> - _.
17.01.2021 - 16:46: , , - Upbringing, Inlightening, Education -> - _.
17.01.2021 - 16:00: - Ecology -> - _.
15.01.2021 - 09:03: , - War, Politics and Science -> - _.
Bourabai Research -  XXI Bourabai Research Institution