system("start website");

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2008
Posts: 14
Reputation: Code Shark is an unknown quantity at this point 
Solved Threads: 0
Code Shark Code Shark is offline Offline
Newbie Poster

system("start website");

 
0
  #1
Jul 13th, 2008
Hello, I read in a thread that you could use
  1. system("start http://www.daniweb.com/");
to get the page Daniweb but I am wanting to write a program that the user can enter a website that he wishes to go to then the program takes the user there.

I got this so far but got errors, I know I've done it wrong - It was only a attempt.

  1. // Code Shark
  2.  
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. char website[50];
  9.  
  10. cout << "Enter a website : ";
  11. cin >> website;
  12.  
  13. system("start", website);
  14.  
  15. return 0;
  16.  
  17. cin.get();
  18. cin.get();
  19. }
Last edited by Code Shark; Jul 13th, 2008 at 12:49 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: system("start website");

 
0
  #2
Jul 13th, 2008
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string website;
  9.  
  10. cout << "Enter a website : ";
  11. cin >> website;
  12. string a = "start ";
  13. string b = a + website;
  14.  
  15. system ( b.c_str() );
  16.  
  17. cin.get();
  18. cin.get();
  19. return 0;
  20. }

sample input:

Enter a website : www.google.com
Last edited by iamthwee; Jul 13th, 2008 at 1:07 pm.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 37
Reputation: Shadoninja is an unknown quantity at this point 
Solved Threads: 0
Shadoninja Shadoninja is offline Offline
Light Poster

Re: system("start website");

 
0
  #3
Jul 13th, 2008
Originally Posted by iamthwee View Post
system ( b.c_str() );
What is c_str() doing?
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,846
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 753
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: system("start website");

 
1
  #4
Jul 13th, 2008
>What is c_str() doing?
Why don't you read a C++ reference and find out?
New members chased away this month: 4
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 37
Reputation: Shadoninja is an unknown quantity at this point 
Solved Threads: 0
Shadoninja Shadoninja is offline Offline
Light Poster

Re: system("start website");

 
0
  #5
Jul 13th, 2008
Because he obviously knows what it is already
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,846
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 753
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: system("start website");

 
1
  #6
Jul 13th, 2008
>Because he obviously knows what it is already
Your logic (or lack thereof) has stumped me. Can you explain what you mean and why you don't seem interested in doing as I suggested?
New members chased away this month: 4
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 37
Reputation: Shadoninja is an unknown quantity at this point 
Solved Threads: 0
Shadoninja Shadoninja is offline Offline
Light Poster

Re: system("start website");

 
-1
  #7
Jul 13th, 2008
Why would I go into a C++ reference and go looking for the command when someone like you could clearly help me quicker
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: system("start website");

 
0
  #8
Jul 13th, 2008
>Why would I go into a C++ reference and go looking for the command when someone like you could clearly help me quicker

Gotta give him credit for that! Bless.
Last edited by iamthwee; Jul 13th, 2008 at 2:59 pm.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,846
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 753
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: system("start website");

 
1
  #9
Jul 13th, 2008
>Why would I go into a C++ reference and go looking for the
>command when someone like you could clearly help me quicker
Because I'll call you a lazy retard and refuse to help you for the rest of eternity. And I'll encourage everyone else to do the same thing because you're clearly not interested in learning, which is what Daniweb is about. If you don't respect us, we won't respect you.
Last edited by Narue; Jul 13th, 2008 at 3:04 pm.
New members chased away this month: 4
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 37
Reputation: Shadoninja is an unknown quantity at this point 
Solved Threads: 0
Shadoninja Shadoninja is offline Offline
Light Poster

Re: system("start website");

 
-1
  #10
Jul 13th, 2008
Originally Posted by Narue View Post
you're clearly not interested in learning

LOL are you kidding me? I come to this forum and post a question ASKING what a code does and you throw that shit at me? You may know C++ but you are one huge dumbass. I encourage everyone to ignore fools like this.

Originally Posted by Narue View Post
If you don't respect us, we won't respect you.
Please quote me where I showed disrespect to anyone... (Other than just now when you proved to me that you are 12 years old)
Last edited by Shadoninja; Jul 13th, 2008 at 3:18 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC