| | |
Autor | Správa |
---|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal reDo: 24.03.2009 16:22 | |
|
Neviete ako sa da stopnut program v C++ ale inak ako system("pause")???
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 15.05.15 Príspevky: 884 Témy: 3 |
Skus napr.
Kód: while (getchar()!='\n') ; getchar();
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 24.03.2009 20:47 | |
|
ale ved to je C ale ja potrebujem pre C++ ne?takze ine nejake
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 15.05.15 Príspevky: 884 Témy: 3 |
To je jedno, mozes to pouzit aj v C++
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 25.03.2009 15:06 | |
|
to hej ale v knihe je to nedoporucovane pretoze su to funkcie C ci co a niesu take chytre ako C++
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 11.01.09 Prihlásený: 29.03.24 Príspevky: 1385 Témy: 9 Bydlisko: Hrinova | Napísal Fico: 25.03.2009 15:43 | |
|
1.) jazyk C++ je vyvinutý z jazyka C
2.) neznášam, keď sa niekto odvoláva na : "v knihe je napísané .... "
Proste ak ti neutronmind - skúsenejší užívateľ - napíše, že to tak ide, tak ho počúvni.
Jednoducho na konci tvojho programu pred poslednú zátvorku } daj príkaz getchar() a výsledok bude presne taký, ako chceš. To, že to nie je v knižke neznamená, že to nie je správne alebo funkčné.
|
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 25.03.2009 18:19 | |
|
jj viem len to v knihe nevravia pretoze to je kniha O C++ a nie o C ale poznam to nebojte sa vraj podla autora su funkcie C++ lepsie a rozumnejsie ale daju sa pouzivat aj funkcie z C a aj kniznice z C dakujem
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 15.05.15 Príspevky: 884 Témy: 3 |
kenny8911 píše: neutronmind - skúsenejší užívateľ
reDo: Myslim, ze casom sa naucis, ktoru funkciu je kedy lepsie pouzit - napr. casto sa pouzivaju C-ckovske funkcie printf a scanf, kedze cin a cout su pomalsie, vzdy vsak zalezi od konkretneho problemu.
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 25.03.2009 22:11 | |
|
dobre skusim to
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 02.11.07 Prihlásený: 18.03.15 Príspevky: 470 Témy: 22 Bydlisko: Zilinska Un... |
reDo, uc sa, ale zatial nerad nikomu ..... ty v podstate mozes hociake kniznice pouzit hocikde po neakych upravach a ja tes v C++ vyuzivam funkcie z C ako printf a fun. pre necitanie zo suboru, hlavne v OpenGL, kde su vysoke poziadavky na rychlost a naviac getchar v c++ je rozsireny o par dobrych veci na co samotny cin a cout nestacia
_________________ Notebook: HP EliteBook 8740w
You can see my work in my www |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 28.03.2009 18:33 | |
|
ty si dobty ked ves OpenGL vraj to pozna len elita
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 15.05.15 Príspevky: 884 Témy: 3 |
To platilo pred "par" rokmi.
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 28.03.2009 21:41 | |
|
aha mam stare informacie ale oplati sa to ucit ze??
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 15.05.15 Príspevky: 884 Témy: 3 |
Samozrejme, pokial sa tomu chces venovat...
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 29.03.2009 11:00 | |
|
tam ide o grafiku a je tam aj nejaky specificky jazyk ??ako napr C++ alebo neco take alebo to je vsestranne
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 15.05.15 Príspevky: 884 Témy: 3 |
Povodne to bolo urcene pre C, avsak mozes to pouzit aj v Cpp alebo Jave...
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 29.03.2009 11:32 | |
|
dakujem:-)
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 11.01.09 Prihlásený: 29.03.24 Príspevky: 1385 Témy: 9 Bydlisko: Hrinova | Napísal Fico: 29.03.2009 14:02 | |
|
Môžeš to použiť, v čom len chceš, pretože celý kód OpenGL je v knižniciach. Aj v Delphi, aj v assembleri a určite aj vo VB. Nie je to nijako obmedzované.
|
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 29.03.2009 16:41 | |
|
aha to som nevedel dikes
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 02.11.07 Prihlásený: 18.03.15 Príspevky: 470 Témy: 22 Bydlisko: Zilinska Un... |
samozrejme ze to mozes pouzit kde chces, ty mozes po upravach pouzit hocijake externe kniznice v takmer hociakom jazyku , ale pre OpenGL urcite pouzi C++ , lebo v C++ si vsetko robis sam a nie si tak obmedzeny implementaciou, sice je to pre skalnych , ale treba sa ucit, ak ces spracovat grafiku v realnom case tak urcute C++ , ja sa tet idem pustit do PhysX od envidie , je to pecka a setky kniznice su robene v C++.
_________________ Notebook: HP EliteBook 8740w
You can see my work in my www |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 02.04.2009 19:19 | |
|
hej to je pouzite v Mirros' Edge brat to hrava vypada to dobre mas pravdu
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 21.04.2009 21:12 | |
|
poznate nejake IDE pre C/C++ okrem Dev C++,Microsoft Visual Studio 2008 , Borland C++ Builder??
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 05.05.2009 17:44 | |
|
ked mam strukturu napr
Kód: struct OSOBA { int roky=0; char meno[101]; };
preco mi nejde nastavit hned pri pisani to roky?
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 15.05.15 Príspevky: 884 Témy: 3 |
Pretoze takto definujes len tzv. sablonu struktury, nie samotnu strukturu (resp. premennu typu struktura). Nieco taketo by ti vsak imho malo fungovat
Kód: struct OSOBA { int roky; char meno[101]; } osobka = {0, '\0');
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 05.05.2009 18:42 | |
|
takto hej len som sa pytalna ten moj pripad
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 15.05.15 Príspevky: 884 Témy: 3 |
Tak, ako si to chcel ty, ti to imho nepojde...
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 07.05.2009 17:02 | |
|
Mam tento zdojak vlastny samozrejme poriadne primitivne ale s C++ som eln na zaciatku mam tento zdrojak nejaka chyba ohladne vypysania vysledkov aspon tie riadky mi ukazuje
dam ten zdrojak
Kód: #include <iostream>
int main() { using namespace std; float kurz=30.126; float eura; float slovak; char rozhodnutie; cout<<"Ako chcete pocitat: na eura(e) na slovenske (s)\n"; cin>>rozhodnutie; if(rozhodnutie=='e') { cout<<"Kolko je slovenskych?\n"; cin>>slovak; cout<<slovak<<"je"<<eura=slovak/kurz<<endl; } else { cout<<"Kolko je eur?\n"; cin>>eura; cout<<eura<<"je"<<slovak=eura*kurz<<endl; } cout<<"Chcete opakovat? y=ano n=nie\n"; cin>>rozhodnutie; if(rozhodnutie=='y') main(); else system("pause"); return 0; }
pomozte pls
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.05.07 Prihlásený: 29.03.14 Príspevky: 641 Témy: 46 |
hmm takto pisu iba geniovia a idioti (myslim ten text na zaciatku)
takze vobec neviem co sa pytas, ale myslim ze using namespace sa nepise do funkcii - aspon v mojej kratkej c++ kariere som to nikdy vo funkcii nevidel.
|
|
Registrovaný: 08.03.09 Prihlásený: 06.10.20 Príspevky: 1116 Témy: 88 Bydlisko: 00100100 | Napísal autor témy reDo: 07.05.2009 20:48 | |
|
ja mam knihu a tam to je
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 15.05.15 Príspevky: 884 Témy: 3 |
Ak das direktivu using namespace std; do tela funkcie, mozes pouzivat funkcie z menneho priestoru std (bez pouzitia std::) len v tele tejto funckie; ak to das na zaciatok kodu, tak v celom zdrojaku.
Na vstup znaku pouzi clensku funkciu get() objektu cin, takisto nepouzivaj rekurziu tam, kde netreba, toboz nie vyvolavat rekurzivne funkciu main() (v C++ to vraj ani nie je povolene, Dev-C++ mi to vsak kupodivu skompiloval).
Kód: #include <iostream>
using namespace std;
int main(void) { const float kurz = 30.126; float eura, slovak; char rozhodnutie = '\0'; while (1) { cout << "Ako chcete pocitat: na eura(e) na slovenske (s)\n"; cin.get(rozhodnutie); cin.get(); if (toupper(rozhodnutie) == 'E') { cout <<"Kolko je slovenskych?\n"; cin >> slovak; cin.get(); cout << slovak << " je " << slovak/kurz <<endl; } else { cout << "Kolko je eur?\n"; cin >> eura; cin.get(); cout << eura << " je " << eura*kurz << endl; } cout << "Chcete opakovat? Y=ano N=nie\n"; cin.get(rozhodnutie); cin.get(); if (toupper(rozhodnutie) == 'N') break; } system("pause"); return 0; }
_________________ Empty your memory, with a free()… like a pointer! If you cast a pointer to an integer, it becomes the integer, if you cast a pointer to a struct, it becomes the struct… The pointer can crash…, and can overflow… Be a pointer my friend… |
|
Podobné témy | Témy | Odpovede | Zobrazenia | Posledný príspevok |
---|
| c prikaz for v Assembler, C, C++, Pascal, Java | 2 | 555 | 16.09.2011 11:58 mk* | | C cyklus for v Assembler, C, C++, Pascal, Java | 10 | 825 | 26.11.2011 13:57 Fico | | Problem for C++ v Assembler, C, C++, Pascal, Java | 4 | 257 | 06.10.2012 15:49 Xperience | | maual c++ for total lama v Assembler, C, C++, Pascal, Java | 2 | 6843 | 07.11.2006 22:35 etel | | C# Cyklus For, inicializovanie a vytvorenie "labelov" pomoc v Technológia .NET | 1 | 503 | 28.03.2013 19:01 walther | | Crysis - all low = 40fps ---- all medium = 40fps wtf? v nVidia grafické karty | 12 | 846 | 29.11.2007 16:18 sairik | | CUSTOM CSS FOR MAIN CONTENT AREA ONLEY FOR MAIN PAGE v HTML, XHTML, XML, CSS | 6 | 539 | 29.10.2013 15:21 Beatdownhaus | | Mám sa učiť C ++/objective C/ C#? v Assembler, C, C++, Pascal, Java | 5 | 724 | 08.07.2014 20:40 XOLOO | | P: Server memory 4GB 2x 2GB dual-rank x4 DDR2 400 MHZ PC2-3200 REG ECC 4GB RAM DDR2 400 for Dell PE6850 FOR HP DL140 G2 v Predám | 0 | 448 | 26.11.2014 9:14 sulino611 | | all share v Smartfóny a tablety | 0 | 367 | 24.12.2011 11:04 enzo22 | | All programy v Ostatné programy | 2 | 587 | 16.12.2008 16:42 walther | | All in one v PC zostavy | 0 | 394 | 24.11.2014 12:01 borgesko | | Problém Hry [ALL] v Počítačové hry | 4 | 336 | 31.07.2013 9:30 patrikos68 | | Photoshop - Close all v Grafické programy | 2 | 596 | 04.09.2008 14:12 dulius | | All in One v PC zostavy | 28 | 1305 | 12.07.2012 9:00 M0f0 | | Lagy - all hry [ Choď na stránku: 1, 2, 3 ] v Počítačové hry | 74 | 2421 | 25.05.2011 12:51 Missko |
| Nemôžete zakladať nové témy v tomto fóre Nemôžete odpovedať na témy v tomto fóre Nemôžete upravovať svoje príspevky v tomto fóre Nemôžete mazať svoje príspevky v tomto fóre
|
|