hey, i knda new to c programming so please don't be too harsh.
anyway i would like to open a website using a c program. (eg. www.google.ie).
does anyone know of a function that can do this?? would appreciate it if you do.
hey, i knda new to c programming so please don't be too harsh.
anyway i would like to open a website using a c program. (eg. www.google.ie).
does anyone know of a function that can do this?? would appreciate it if you do.
With open a website, are you talking about opening it in your default web browser?
On Windows you can do
But know that system is pretty unsafe and you should do some checking before using it if it relies on user input, secondly while system() calls are portable that way of opening a web site only applies to Windows AFAIK so if you wan't something more portable you'd have to figure out some way to get the path to your webbrowser and replace "run" with that path.Code:#include <stdlib.h> system("run www.google.ie");
Also you could use ShellExecute()
Code:ShellExecute(NULL, TEXT("open") , TEXT("http://www.iland.net/"), NULL, NULL, SW_SHOWNORMAL);
does that work on both linux and windows?Originally Posted by adr
To clarify: Do you mean you would like to download the source code to the website or do you want to open the site inside of a browser?
i would like to open the site in the browser. a friend in college recommended to use shellexecute and so did a lecturer in programming. the system("run ...") did not work, for me anyway.
thanks for the help anyway