Ładny brzuch
witam,
napisalem sobie taki programik:)
#include <iostream.h> #include <conio.h> #include <iomanip.h> int main(){ ostream & temp(ostream & strum){ strum << setprecision(1) << setw(5) << setfill('*'); } int temperatura; temperatura = 456; cout << temp << temperatura; getch(); }
niestety nie dzialal i problem tkwil w tym, ze funkcja
ostream & temp(ostream & strum){
powinna by globalna...
czyli taki skrypt juz dzialal:
#include <iostream.h> #include <conio.h> #include <iomanip.h> int main(){ ostream & temp(ostream & strum){ strum << setprecision(1) << setw(5) << setfill('*'); } int temperatura; temperatura = 456; cout << temp << temperatura; getch(); }
czy moze mi ktos wytlumaczyc dlaczego ta funkcja musiala byc globalna?
nie moge nigdzie sie doszukac rozwiazania
bylbym bardzo wdzieczny
pozdrawiam
Ka-
Definiowanie funkcji wewntrz innej funkcji? Dobrze si czujesz?
Swoj drog nastpnym razem spjrz na to co napisae - teraz obydwa kody s takie same. ;)
zanotowane.pl doc.pisz.pl pdf.pisz.pl zsf.htw.pl
napisalem sobie taki programik:)
#include <iostream.h> #include <conio.h> #include <iomanip.h> int main(){ ostream & temp(ostream & strum){ strum << setprecision(1) << setw(5) << setfill('*'); } int temperatura; temperatura = 456; cout << temp << temperatura; getch(); }
niestety nie dzialal i problem tkwil w tym, ze funkcja
ostream & temp(ostream & strum){
powinna by globalna...
czyli taki skrypt juz dzialal:
#include <iostream.h> #include <conio.h> #include <iomanip.h> int main(){ ostream & temp(ostream & strum){ strum << setprecision(1) << setw(5) << setfill('*'); } int temperatura; temperatura = 456; cout << temp << temperatura; getch(); }
czy moze mi ktos wytlumaczyc dlaczego ta funkcja musiala byc globalna?
nie moge nigdzie sie doszukac rozwiazania
bylbym bardzo wdzieczny
pozdrawiam
Ka-
Definiowanie funkcji wewntrz innej funkcji? Dobrze si czujesz?
Swoj drog nastpnym razem spjrz na to co napisae - teraz obydwa kody s takie same. ;)