Stránka: 4 z 7
| [ Príspevkov: 198 ] | 1, 2, 3, 4, 5, 6, 7 |
| Autor | Správa |
|---|
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
nwm co je to compare zatial dikes za to i aspon to zmena ´´ q mal byt test ci sa zmena nerovna q/Q to by bo lkoniec a chybu som sa znazil najst ale nevedel som to najst 
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 03.12.25 Príspevky: 884 Témy: 3 | 3 |
Chyba ti tam aj
Kód: #include <string>
_________________ 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ý: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
e ved tam mam
#include <cstring>
sksuet si to v DevC++ a vyise vam ze zly operator alebo co skuste a uvidite 
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 03.12.25 Príspevky: 884 Témy: 3 | 3 |
Ale cstring je nieco ine ako string. string obsahuje deklaraciu triedy string a cstring rozne Cckovske funkcie na pracu s retazcami(string.h).
_________________ 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ý: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
aha dakujem to som nevedel sry nepomohlo to 
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 11.01.09 Prihlásený: 28.04.26 Príspevky: 1399 Témy: 10 | 10 Bydlisko: Hrinova |
reDo píše: cawte som tu zase nejde mi jeden program ma zmenit male n avelke pismena kukni sa na to niekdo ...
Drobná úprava. Čomu nerozumieš, kľudne sa pýtaj:
Kód: #include <iostream> #include <cstring> #include <cctype>
using namespace std;
string & velke(string & zmena);
int main() { string slovo; cout << "Zadaj slovo alebo q:\n"; cin >> slovo; velke(slovo); cout << slovo << endl; system("pause");
return 0; }
string & velke(string & zmena) { int i=0;
if ((toupper(char(zmena[0])) == 'Q') && (zmena.length() == 1)) { zmena = '\0'; return zmena; }
while(zmena[i] != '\0') { zmena[i] = toupper(zmena[i]); i++; }
return zmena; }
|
|
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
zmena. length() to este neviem vysvetlis to a este by som potrebovbal vystvetlit .compare() dakujem za ten program
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 11.01.09 Prihlásený: 28.04.26 Príspevky: 1399 Témy: 10 | 10 Bydlisko: Hrinova |
zmena.length() - vracia počet znakov v reťazci zmena. Príklad.
zmena.compare(const string& str) - porovná reťazec zmena s reťazcom str (može tam byť aj znak). Ak je návratová hodnota menšia ako nula, zmena < str. Ak je návratová hodnota väčšia ako nula, zmena > str. A ak je rovná nule, zmena == str. Príklad.
|
|
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
dikes a este jedna otazkocka ako by sa dalo urobit inak ze rovno porovnam ten odkazovy retazec s q/Q neviete poradit?
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 11.01.09 Prihlásený: 28.04.26 Príspevky: 1399 Témy: 10 | 10 Bydlisko: Hrinova |
Napríklad takto:
Kód: string & velke(string & zmena) { int i=0;
while(zmena[i] != '\0') { zmena[i] = toupper(zmena[i]); i++; } if ( zmena.compare("Q") == 0 ) { zmena = '\0'; return zmena; }
return zmena; }
|
|
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
uhm diky
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 26.06.09 Prihlásený: 03.04.12 Príspevky: 47 Témy: 7 | 7 Bydlisko: Trencianska... |
cawte, instaloval som Gears of war a pri spusteni mi to vyhodilo tabulku s chybou v cervenom ramceku:
Microsoft Visual C++ Runtime Library
Co s tym mam spravit?
Dakujem za odpoved
_________________ Intel Core i5-750, 4GB RAM Corsair 1600MHz, 500GB Samsung F3, Gigabyte P55-UD3L, Sapphire HD 5850, |
|
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
taky som mal aj ja na CS 1.6 skus reinstal
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 26.06.09 Prihlásený: 03.04.12 Príspevky: 47 Témy: 7 | 7 Bydlisko: Trencianska... |
skusal som aj to, ale ani to nepomohlo. Poradili mi, aby som vypol nieco na panely rychleho spustania. Nevies, to tym mysleli? Skusal som aj patche a aj tak to nepomaha. Je to uz po 3, co som to tahal nanovo.
|
|
Registrovaný: 06.05.09 Prihlásený: 06.08.09 Príspevky: 61 Témy: 7 | 7 Bydlisko: Bytča | |
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
nwm co tym mysleli sry
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 26.06.09 Prihlásený: 03.04.12 Príspevky: 47 Témy: 7 | 7 Bydlisko: Trencianska... |
K tomuto chování dojde v případě, že program koliduje se soubory Mosdmn.exe a Mosearch.exe.
Soubory Mosdmn.exe a Mosearch.exe jsou částí funkce Podpora pro funkci Rychlé hledání v sadě Office XP. Tato funkce je podobná nástroji Rychlé hledání v sadě Microsoft Office 2000. Funkce Rychlé hledání používá službu indexování v sadě Office XP k vytváření katalogu souborů sady Office na pevném disku počítače.
Toto som nasiel na jednej stranke. Da sa to niako preprogramovat, alebo reinstalnut len office alebo cely windows
_________________ Intel Core i5-750, 4GB RAM Corsair 1600MHz, 500GB Samsung F3, Gigabyte P55-UD3L, Sapphire HD 5850, |
|
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
preprogramovat asi tazko skus sa oibratit na inu cast fora inu sekciu
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 26.06.09 Prihlásený: 03.04.12 Príspevky: 47 Témy: 7 | 7 Bydlisko: Trencianska... |
nevies nahodou kam by som sa mal obratit lebo som tu novy tak neviem kam
_________________ Intel Core i5-750, 4GB RAM Corsair 1600MHz, 500GB Samsung F3, Gigabyte P55-UD3L, Sapphire HD 5850, |
|
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
toto je len sksuaka ale nwm ako urobit aby sa mi nacital retazec a nie znak poradte
Kód: #include <iostream>
using namespace std;
int main() { char * pole= new char[5]; cin>>pole[0]; cin>>pole[1]; cout<<pole[0]<<endl<<pole[1]<<endl; system("pause"); return 0; }
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 03.12.25 Príspevky: 884 Témy: 3 | 3 |
_________________ 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ý: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
no dobre ale ja potrtebujem nacitat 5 retazcov a nie jeden
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
Ja chcem nacitat pet retazcov a nie jeden retazec alebo znak! Viue to niekdo ako to spravit?
_________________ 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 | 46 |
omg jasne ze to tu niekto vie - nenapadlo ta ze tak ako nacitas jeden tak ked to spravis 5krat tak nacitas 5? proste si vytvor 5 retazcov a tie nacitaj v akom poradi chces, comu nerozumies?
|
|
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
ale ja potrebujem pole ukazatlov na char to je sucast zadania takye to nemoyem inakspravit
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 03.12.25 Príspevky: 884 Témy: 3 | 3 |
Potom ale musis spravit dvojrozmerne pole.
Kód: char pole[5][10]; // pripadne alokuj pamat dynamicky pomocou new ak chces for(int i = 0; i < 5; cin>>pole[i++]);
_________________ 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ý: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
no to mi uzporadili aj na druhom fore takze to tak urobim sdkoda
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 08.03.09 Prihlásený: 17.01.25 Príspevky: 1116 Témy: 88 | 88 Bydlisko: 00100100 |
teraz sa ucim sablony a take podobne ako pretazovanie a ine a mam zadanie napiste sablonu fonkcie ktora prebera ako jeden parameter pole a druhy pocet prvkov a mala by vracat najvecsi prvok pola otestujte ho v programe s polom 6 hodnot typu double a 5 typu int a mala by tam byt aj explicitna specializacia pre pole ukazatelov na char a pocet prvkov toho pola ako druhy parameter zas a vracia najdlhsii retazec ak je iuch viac tak prvy no vecsinu som pochopil aj vedel ale nejde mi program tak ako b mal a mam tam chyby ktorym nerozumiem tu na je to co som zatial dokazal urobit ale nefunguje to
Kód: #include <iostream> #include <cstring> #include <string.h> using namespace std; template <class T> T max(T pole[], int pocet);
template <> char * max<char, int>(char * pole[], int pocet);
int main() { char * pole[3]; pole[0]="Adamko"; pole[1]="MATUSKOJEwow2"; pole[2]="MATUSKOJEwow1"; char * pom=max(pole, 3); cout<<pom<<endl; double poledou[5]={1, 2, 3, 4, 5}; double pomdo=max(poledou, 5); cout<<pomdo<<endl; system("pause"); return 0; } template <class T> T max(T pole[], int pocet) { int i=0; T max=pole[i]; for(;i<pocet;i++) if(max<pole[i]) { max=pole[i]; } return max; } template <> char * max<char, int>(char * pole[], int pocet){ int * pompole= new int[pocet]; int x=0; int pommax=strlen(pole[0]); char * pom=NULL; for(int i=0;i<pocet;i++){ pompole[i]=strlen(pole[i]); if(pommax<pompole[i]){ pommax=pompole[i]; x=i; } } pom=pole[x]; return pom; }
a ako sa da urobit specializacia na viac typov a tak?? 
_________________ Programming is The Best
Hackers Are Not Crackers!!! Hackers build things, crackers break them!
;-) |
|
Registrovaný: 30.04.08 Prihlásený: 03.12.25 Príspevky: 884 Témy: 3 | 3 |
Kód: #include <iostream> #include <cstring> #include <string>
using namespace std;
template <typename T> T maxn(T p, int n) { T MAX = p;
for (int i = 0; i < n; MAX = ((*MAX > p[i]) ? MAX : p+i), ++i); return MAX; }
template <> char * maxn(char *p, int n) { char * MAX = new char[strlen(p) + 1];
strcpy(MAX, p); for (int i = 0; i < n; ++i) if (strcmp(MAX, p) > 0) strcpy(MAX, p); return MAX; }
int main(void) { double p_d[6] = {3.141, 2.718, 1.618, 0.567, 1.414, 0.660}; int p_i[5] = {0, 1, 42, 47, -1}; char * p_c[5] = {"string", "c++", "011235813", "47", "lol"};
cout << "Najvacsie cislo typu double: " << *maxn(p_d, 6) << endl; cout << "Najvacsie cislo typu int: " << *maxn(p_i, 5) << endl; cout << "Lexikograficky najvacsi retazec: " << *maxn(p_c, 5) << endl;
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… |
|
Stránka: 4 z 7
| [ Príspevkov: 198 ] | 1, 2, 3, 4, 5, 6, 7 |
|