Ar3us 0 Odesláno: 17. Listopad, 2014 Share Odesláno: 17. Listopad, 2014 Zdravím, udělal jsem si jednoduchý program, který Vám vypíše nějaké texty viz. Spoiler #include <iostream> #include <cstring> #include "napis.h" using namespace std; int a, b; int main() { napis welcome("Zkouska 1"); welcome.vypis(); welcome.nastav("Zadejte pocet: "); welcome.vypis(); cin >> a; napis hodnota("Zadali jste coz je cislo."); hodnota.vypis(); napis konec("Zadejte 0 pro ukonceni programu: "); konec.vypis(); cin >> b; while (b != 0) { napis konecc(" Zadali jste: ale mate zadat 0"); konecc.vypis(); cin >> b; } return 0; } Potřeboval bych do textu přidat zadané hodnoty. Prosím, jak to udělám? Link to comment Share on other sites More sharing options...
steel 71 Odesláno: 17. Listopad, 2014 Share Odesláno: 17. Listopad, 2014 int a,b; nemáš zainicializované metodu vypis() tam také nemáš Jaké hodnoty tam chceš přidat? int a = hodnota; int b = hodnota; , to je vstup. Link to comment Share on other sites More sharing options...
Ar3us 0 Odesláno: 17. Listopad, 2014 Author Share Odesláno: 17. Listopad, 2014 Vypis jsem si udělal v druhém soubory to jev pořádku ale já chci po zadání hodnotyaaB jakjetomu níže vCin... a pak to chci hodit do těch textů. A ty hodnoty se právě vypisují uživatelem Link to comment Share on other sites More sharing options...
Deleted User 295 Odesláno: 17. Listopad, 2014 Share Odesláno: 17. Listopad, 2014 posli nam sem deklaraciu triedy napis, tato to je dost tazke ti poradit. Ale tak vypis cisla mas normalne cez cin/cout int a; cin >> a; cout << a; ak chces konvertovat int na string tak bud Cckovnske fce atoi/itoa alebo C++ triedu stringstream Link to comment Share on other sites More sharing options...
HellNoKitty 2 Odesláno: 17. Listopad, 2014 Share Odesláno: 17. Listopad, 2014 A co napis hodnota("Zadali jste " + to_string(a) + " coz je cislo."); Link to comment Share on other sites More sharing options...
Deleted User 295 Odesláno: 17. Listopad, 2014 Share Odesláno: 17. Listopad, 2014 btw. pouzivas triedy a konstruktory uplne blbo Link to comment Share on other sites More sharing options...
steel 71 Odesláno: 17. Listopad, 2014 Share Odesláno: 17. Listopad, 2014 spletl sem si topic Link to comment Share on other sites More sharing options...
Ar3us 0 Odesláno: 17. Listopad, 2014 Author Share Odesláno: 17. Listopad, 2014 Nechápu toje tu zmatek Link to comment Share on other sites More sharing options...
HellNoKitty 2 Odesláno: 17. Listopad, 2014 Share Odesláno: 17. Listopad, 2014 Nechápu toje tu zmatek Naco vytvaris objekt na vypis textu misto cout? Link to comment Share on other sites More sharing options...
Ar3us 0 Odesláno: 17. Listopad, 2014 Author Share Odesláno: 17. Listopad, 2014 Zkouším ne? Link to comment Share on other sites More sharing options...
KUMA s.r.o 2 Odesláno: 4. Srpen, 2015 Share Odesláno: 4. Srpen, 2015 WTF pošli čo máš v tom header napis.h :DD Link to comment Share on other sites More sharing options...
steel 71 Odesláno: 4. Srpen, 2015 Share Odesláno: 4. Srpen, 2015 Po dvou letech to asi už nepotřebuje a nikdo jiný to potřebovat nebude, takže je zbytečné to řešit, krom toho myslím, že to má vyřešené, takže už tuplem je zbytečné to řešit. Jsi asi na internetovém fóru poprvé, gratuluji. 2 Link to comment Share on other sites More sharing options...
KUMA s.r.o 2 Odesláno: 4. Srpen, 2015 Share Odesláno: 4. Srpen, 2015 Jáj nevšimol som si dátum videl som to prose v prvých medzi programovaním tak sorry chcel som pomôcť Link to comment Share on other sites More sharing options...
Recommended Posts