943,636 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2839
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Jul 13th, 2008
0

system("start website");

Expand Post »
Hello, I read in a thread that you could use
C++ Syntax (Toggle Plain Text)
  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.

C++ Syntax (Toggle Plain Text)
  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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Code Shark is offline Offline
14 posts
since Jul 2008
Jul 13th, 2008
0

Re: system("start website");

C++ Syntax (Toggle Plain Text)
  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.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jul 13th, 2008
0

Re: system("start website");

Click to Expand / Collapse  Quote originally posted by iamthwee ...
system ( b.c_str() );
What is c_str() doing?
Reputation Points: 10
Solved Threads: 0
Light Poster
Shadoninja is offline Offline
37 posts
since Jul 2008
Jul 13th, 2008
1

Re: system("start website");

>What is c_str() doing?
Why don't you read a C++ reference and find out?
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jul 13th, 2008
0

Re: system("start website");

Because he obviously knows what it is already
Reputation Points: 10
Solved Threads: 0
Light Poster
Shadoninja is offline Offline
37 posts
since Jul 2008
Jul 13th, 2008
1

Re: system("start website");

>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?
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jul 13th, 2008
-1

Re: system("start website");

Why would I go into a C++ reference and go looking for the command when someone like you could clearly help me quicker
Reputation Points: 10
Solved Threads: 0
Light Poster
Shadoninja is offline Offline
37 posts
since Jul 2008
Jul 13th, 2008
0

Re: system("start website");

>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.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jul 13th, 2008
1

Re: system("start website");

>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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jul 13th, 2008
-1

Re: system("start website");

Click to Expand / Collapse  Quote originally posted by Narue ...
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.

Click to Expand / Collapse  Quote originally posted by Narue ...
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.
Reputation Points: 10
Solved Threads: 0
Light Poster
Shadoninja is offline Offline
37 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Advantages: C++/Java
Next Thread in C++ Forum Timeline: Opening other programs





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC