Uroci.net - !
Adobe Photoshop Adobe Illustrator Adobe Flash Adobe Fireworks DreamWeaver CSS HTML Corel Draw Image Ready PHP SEO CMS Microsoft Windows Microsoft Word Microsoft Excel PowerPoint Microsoft Access Microsoft Publisher Linux Visual basic JavaScript Ajax 3ds Max Maya 3D C++
C++
Sound Forge Gimp SWiSH

C++ .4 ( )

C++ » C++
fix3d   :    : 6168


4: .

:
4.1.
4.2. inline
4.3.
4.4.
4.5.
4.6.
4.7. - (reference)
4.8. -
4.9.
4.10.


. - , . , , , . . , , void.

, , . ({}) .

intline int abs( int i ) { // return the absolute value of i
return( i < 0 ? -i; i );
}

inline int min( int v1, int v2 ) { // return the smaller of two values
return ( v1 < v2 ? v1 ; v2 );
}

gcd( int v1, int v2 ) {
// return greatest common denominator
int temp;
while ( v2 ) {
temp = v2;
v2 = v1 % v2;
v1 = temp;
}
return v1;
}

, ("()"). , , , . . . main() abs() , min() gcd() . main.C.

#include <stream.h>
#include "localMath.h"

main(){
int i, j;
cout << "Value "; // get value from standart input
cin >> i;
cout << "Value ";
cin >> j;
cout << "nmin " << min( i, j ) << "n";
i = abs( i );
j = abs( i );
cout << "gcd " << gcd( i, j ) << "n";
}

. inline, ; . . , . , .

.

, , . , . , . - , , . .

, . . .

main. C abs(), min() gcd() ; main() .

( , )

int abs( int );
int min( int, int );
int gcd( int, int );

- ( online) . , . ; .

localMath.h. (inline , )

int gcd( int, int );// inlines are placed within header file
inline abs( int i) {
return( i<0 ? -i ; i ); }
inline min( int v1, int v2) {
return( v1 <= v2 ? v1 ; v2 ); }

$ CC main. C gcd.C


Value 15
Value 123
min 15
gcd 3



: 1 2 3 4 »

,


© . 2006-2008. Created by: Site.bg
: IT | | . | Paparak.bg | | uchenik.com | TRAVEL | | AmAm.bg | . | | AnimeS-bg.com | | | | IT Light | Spodeli.net | - | IDG.BG | Teenproblem.net | - | Fresh-BG.com | Hanovete.com | Bulfleet.com | Mythlands.com | Ohoboho.com | .Com | News24 | Setcom.bg | Atol.bg | Elmaz.com | MobileBulgaria.com