|
|
 |
 |
 |
 |
opening website
how to open a website like yahoo.com and use it as input? The following code doesn't work. #include"stdio.h" int main() { FILE *f; f=fopen("http://www.yahoo.com","r"); if(f==NULL) puts("Error opening file"); return 0;
}
Umesh <fraternitydispo @gmail.com> writes: > how to open a website like yahoo.com and use it as input? The standard C language and library don't provide a way. I suggest that you look for an implementation-specific solution in a newsgroup specific to your environment. > #include"stdio.h"
Should be #include <stdio.h>. > int main()
It's better to write function declarations in prototype form: int main(void) Normally this function call would have indentation beyond that of the if statement.. > return 0; > }
-- Comp-sci PhD expected before end of 2007 Seeking industrial or academic position *outside California* in 2008
On 6 5 , 12 29 , Umesh <fraternitydispo@gmail.com> wrote:
> how to open a website like yahoo.com and use it as input? The > following code doesn't work. > #include"stdio.h" > int main() > { > FILE *f; > f=fopen("http://www.yahoo.com","r"); > if(f==NULL) > puts("Error opening file"); > return 0; > }- - > - -
i'm a Chinese student, my msm ID is :flyrea@163.com, could you please add me as your fiend??
The c itself do not support opetations to network.It relay on platform you used.
On 6 5 , 2 19 , Jinsere <bishi@gmail.com> wrote: > The c itself do not support opetations to network.It relay on platform > you used.
take a look at lib curl.
"Umesh" <fraternitydispo@gmail.com> schrieb im Newsbeitrag news:1181017745.020394.112200@z28g2000prd.googlegroups.com... > how to open a website like yahoo.com and use it as input? The > following code doesn't work. > #include"stdio.h"
#include <stdio.h> fopen is for opening a file stream, not a network connection. Opening network connections is not topical here, try comp.unix.programmer. > if(f==NULL) > puts("Error opening file");
fputs(stderr, "Error opening file"); error messages should go to stderr, not stdout > return 0; > }
Bye, Jojo
The standard says very little about how file names are interpreted. An implementation could easily support URLs as file names. (I know of none that do so.) -- Keith Thompson (The_Other_Keith) k@mib.org <http://www.ghoti.net/~kst> San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst> "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"
On Jun 4, 9:29 pm, Umesh <fraternitydispo@gmail.com> wrote: > how to open a website like yahoo.com and use it as input? The > following code doesn't work. > #include"stdio.h" > int main() > { > FILE *f; > f=fopen("http://www.yahoo.com","r"); > if(f==NULL) > puts("Error opening file"); > return 0; > }
try using 'wput' . See man page for more info, or mail help to hagen (at) itooktheredpill.dyndns.org He might help you in this regards, Bye Guru Jois
"Keith Thompson" <k@mib.org> schrieb im Newsbeitrag news:lntztm7rvz.fsf@nuthaus.mib.org... > "Joachim Schmitz" <nospam.j @schmitz-digital.de> writes: >> "Umesh" <fraternitydispo @gmail.com> schrieb im Newsbeitrag >> news:1181017745.020394.112200@z28g2000prd.googlegroups.com... > [...] >>> f=fopen(" http://www.yahoo.com","r"); >> fopen is for opening a file stream, not a network connection. >> Opening network connections is not topical here, try >> comp.unix.programmer. > The standard says very little about how file names are interpreted.
True > An implementation could easily support URLs as file names. (I know of > none that do so.)
Umesh's implementation apparently doesn't either. Bye, Jojo
Guru Jois said: <snip> > try using 'wput' .
There is no wput function in C. Please learn C before trying to teach it. -- Richard Heathfield "Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk email: rjh at the above domain, - www. |
 |
 |
 |
 |
|