Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pokretanje drugog programa u C++
Author Message
matijaivanus Offline
Novi korisnik
*

Posts: 51
Joined: Feb 2010
Reputation: 0
Post: #1
Big Grin Pokretanje drugog programa u C++
ja sam pocetnik pa bih pitao je li je moguce
u program tipa:
#include <iostream>
using namespace std;
int main () {
float a;
cout<<"Upisi password: ";
cin>>a;
if (a!=123456) {
cout<<"Krivi password"<<endl;
w:
cout<<"Pogadaj ponovno: "<<endl;
cin>>a;}
if (a!=123456) {
cout<<"Krivi password"<<endl;
goto w;
}
else {
cout<<"Tocan password"<<endl;
}




return 0;
}
staviti umjesto da ipise "tocan password" staviti da pokrene neki drugi program.
tnx unaprjed.

Never argue with an idiot: first he will drag you down to his level, then he will beat you with experience.
25-02-2010 05:02 PM
Find all posts by this user Quote this message in a reply
danielvast Offline
Forumaš
***

Posts: 432
Joined: Dec 2009
Reputation: 22
Post: #2
RE: c++
Hej matijaivanus pozdrav!
Osobno bavim se programiranjem u c-u vec godinu dana i nebih ti znao odgovorit na to pitanje, ali dakako ima tu ljudi puno sturučnijih od mene koji mozada znaju! Bilo kako bilo preporucio bih ti da pocnes sa jednostavnijim stvarima! Happy Ukoliko si početnik u programiranju!
OH i BTW goto petlje u c-u nisu ti dobra ideja iz mnogih razloga mozda da ovo ostvaris preko neke while petlje bila bi ti dobra vjezba!

"When all else fails, read the manual."
(This post was last modified: 25-02-2010 05:32 PM by danielvast.)
25-02-2010 05:24 PM
Find all posts by this user Quote this message in a reply
kecko Offline
Forumaš
***

Posts: 645
Joined: Nov 2009
Reputation: 20
Post: #3
RE: c++
nije komplicirano, može se na više načina, najjednostavnije bi bilo uključiti #iinclude<cstdlib>
i sa komandom system("program.exe"); to bi bilo najjednostavnije... ako trebaš nešt kompliciranije onda treba pogledati fork i exec
25-02-2010 05:46 PM
Find all posts by this user Quote this message in a reply
danielvast Offline
Forumaš
***

Posts: 432
Joined: Dec 2009
Reputation: 22
Post: #4
RE: c++
OVO nisam znao kao sto bi rekli
Quote:Živiš i učiš

"When all else fails, read the manual."
25-02-2010 06:00 PM
Find all posts by this user Quote this message in a reply
matijaivanus Offline
Novi korisnik
*

Posts: 51
Joined: Feb 2010
Reputation: 0
Post: #5
RE: c++
tnx ljudi

Never argue with an idiot: first he will drag you down to his level, then he will beat you with experience.
25-02-2010 06:47 PM
Find all posts by this user Quote this message in a reply
kecko Offline
Forumaš
***

Posts: 645
Joined: Nov 2009
Reputation: 20
Post: #6
RE: c++
komanda system ti ustvari izvršava bilo što kao da kucaš u command promptu...
25-02-2010 06:54 PM
Find all posts by this user Quote this message in a reply
danielvast Offline
Forumaš
***

Posts: 432
Joined: Dec 2009
Reputation: 22
Post: #7
RE: c++
Code:
system("arp -a");
system("pause");
Kada sam ovo pokusao kompajlirati antivirus mi je javio da je ta izvršna datoteka zapravo virus i to Trojan horse Generic13.AQNR???
Zna li itko zašto?

"When all else fails, read the manual."
(This post was last modified: 25-02-2010 07:22 PM by danielvast.)
25-02-2010 07:20 PM
Find all posts by this user Quote this message in a reply
matijaivanus Offline
Novi korisnik
*

Posts: 51
Joined: Feb 2010
Reputation: 0
Post: #8
RE: c++
evo napiso sam kod ovako ali kad gapokrenem i upisem sifru ne prepoznaje i nece otvorit wow.exe
#include <iostream>
#include<cstdlib>
using namespace std;
int main () {
float a;
cout<<"Upisi password: ";
cin>>a;
while (a!=123456) {
cout<<"Krivi password"<<endl;

cout<<"Pogadaj ponovno: "<<endl;
cin>>a;}


cout<<"Tocan password"<<endl;

system("wow.exe");



return 0;}
i u kojoj se biblioteci exec() nalazi

Never argue with an idiot: first he will drag you down to his level, then he will beat you with experience.
25-02-2010 08:07 PM
Find all posts by this user Quote this message in a reply
danielvast Offline
Forumaš
***

Posts: 432
Joined: Dec 2009
Reputation: 22
Post: #9
RE: c++
Zadatak odnosno izvršna datoteka ti treba biti u istom folderu kao i wow.exe izvršna datoteka.

"When all else fails, read the manual."
25-02-2010 08:25 PM
Find all posts by this user Quote this message in a reply
matijaivanus Offline
Novi korisnik
*

Posts: 51
Joined: Feb 2010
Reputation: 0
Post: #10
RE: c++
jel mogu napravit da netreba bit u istom folderu

Never argue with an idiot: first he will drag you down to his level, then he will beat you with experience.
25-02-2010 08:28 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)