[ unknown-3 @ 18.09.2005. 13:59 ] @
For example

Code:
#include <iostream>


int AreaCube(int lenght = 100, int width = 25, int height = 1);

int main (int argc, char *argv[])

{
    int lenght = 100;
    int width = 50;
    int height = 2;
    int area;
    
    area = AreaCube(lenght,width,height);
    cout << "Prva zapremina iznosi bato: "<< area << "\n";
    
    area = AreaCube(lenght,width);
    cout << "U drugom pozivu zapremina iznosi: "<< area << "\n";
    
    area = AreaCube(lenght);
    cout << " U trecem pozivu zapremina iznosi: "<< area << "\n";
    return 0;
    
}

int AreaCube(int lenght,int width,int height)
{
             
             return(lenght * width * height);
}



E sad,sto moram umesto "\n" da stavim std::endl.Video sam u knjizi da pise da samo stavim main();Sad sam video da treba ovako.zasto to treba da se doda.Dal je to do knjige il do kompajlera?help:>
[ Burgos @ 18.09.2005. 14:38 ] @
To znaci da moras se da konstanta\funkcija nalaziu std namespaceu. Mozes to da resis ovako:

Code:
#include <iostream>


int AreaCube(int lenght = 100, int width = 25, int height = 1);

using namespace std;

int main (int argc, char *argv[])

{
    int lenght = 100;
    int width = 50;
    int height = 2;
    int area;
    
    area = AreaCube(lenght,width,height);
    cout << "Prva zapremina iznosi bato: "<< area << endl;
    
    area = AreaCube(lenght,width);
    cout << "U drugom pozivu zapremina iznosi: "<< area << endl;
    
    area = AreaCube(lenght);
    cout << " U trecem pozivu zapremina iznosi: "<< area << endl;
    return 0;
    
}

int AreaCube(int lenght,int width,int height)
{
             
             return(lenght * width * height);
}
[ unknown-3 @ 18.09.2005. 14:56 ] @
Znaci areacube se nalazi u tom name spaceu?
[ Gogy @ 18.09.2005. 17:45 ] @
Citat:
unknown-3: Znaci areacube se nalazi u tom name spaceu?

Ne AreaCube nego endl.

Inace,ovdje mozes naci dosta toga o ovoj temi:
http://www.cplusplus.com/doc/tutorial/tut5-2.html
[ Burgos @ 18.09.2005. 17:47 ] @
Ne. Nisam siguran, ali mislim da on trazi deklaracije funkcija u fajlu, pa ako ih ne nadje onda ih trazi u namespaceu.