Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C Programming Language

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)

> {

>   FILE *f;
>   f=fopen("http://www.yahoo.com","r");
>   if(f==NULL)
>   puts("Error opening file");

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:

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>

> int main()
> {

>  FILE *f;
>  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.

>  if(f==NULL)
>  puts("Error opening file");

fputs(stderr, "Error opening file");

error messages should go to stderr, not stdout

>  return 0;
> }

Bye, Jojo

"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.
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.

Guru Jois wrote:
> 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.

... snip ...

> 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,

wput is non-standard.  I don't object to the mention, I do object
to not so-identifying it.

--
 <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
 <http://www.securityfocus.com/columnists/423>
 <http://www.aaxnet.com/editor/edit043.html>
 <http://kadaitcha.cx/vista/dogsbreakfast/index.html>
                        cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Keith Thompson wrote:
> "Joachim Schmitz" <nospam.j@schmitz-digital.de> writes:

... snip ...

>> 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.
> An implementation could easily support URLs as file names. (I know
> of none that do so.)

I seem to remember that Chris Torek has done extensions of this
flavor.

--
 <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
 <http://www.securityfocus.com/columnists/423>
 <http://www.aaxnet.com/editor/edit043.html>
 <http://kadaitcha.cx/vista/dogsbreakfast/index.html>
                        cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

Albert Lee wrote:
> 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.

That is not part of the C standard.

--
 <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
 <http://www.securityfocus.com/columnists/423>
 <http://www.aaxnet.com/editor/edit043.html>
 <http://kadaitcha.cx/vista/dogsbreakfast/index.html>
                        cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

CBFalconer <cbfalco@yahoo.com> wrote:
> wput is non-standard.  I don't object to the mention, I do object
> to not so-identifying it.

It also doesn't seem to be ubiquitous enough to merely refer a
potential user to the man page.

--
C. Benson Manica           | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com      | don't, I need to know.  Flames welcome.

May I automatically open a web page and save it as a text file to c:
\1.txt and then email it through outlook? Which language should I use?
Please guide me. Thank you in anticipation.
Umesh wrote:
> May I automatically open a web page and save it as a text file to c:
> \1.txt and then email it through outlook? Which language should I use?
> Please guide me. Thank you in anticipation.

Something other than C.  Goodbye.

--
Ian Collins.

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc