Change the line
    while((fgetc(input_file))!= EOF)
to
    while((c=fgetc(input_file))!= EOF)

-- 
  Mark Van Peteghem
  http://www.q-mentum.com -- easier and more powerful unit testing


ashwin mittal wrote:

>
> Hi everybody,
>
> I want to copy one picture (i.e. in gif format) to
> other gif format file through C.
>
> I dont want the copy command in C....
>
> But the thing I want is through the file handling in C
> and reading the contents and then copying the contents
> to other file..
> But that other file doesnt have any picture but the
> size of that copied file is absolutely perfect..
>
> Check this code and please tell me where I am wrong...
>
> #include<stdio.h>
> #include<conio.h>
> void main()
> {
>         int c;
>         FILE *output_file;
>         FILE *input_file;
>         if ((input_file = fopen("sample.jpg","rb")) ==
> NULL)
>         {
>                 fprintf(stderr, "Cannot read
> properly\n");
>         }
>         if ((output_file = fopen("output.jpg", "ab"))
> == NULL)
>            fprintf(stderr, "Cannot write properly\n");
>         else
>         {
>                 while((fgetc(input_file))!= EOF)
>                 {
>                         fputc(c,output_file);
>                 }
>         fclose(output_file);
>         }
>
> getch();
> }






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/EbFolB/TM
--------------------------------------------------------------------~-> 

To unsubscribe : [EMAIL PROTECTED]

 
Yahoo! Groups Links

<*> To reply to this message, go to:
    http://groups.yahoo.com/group/Programmers-Town/post?act=reply&messageNum=3660
    Please do not reply to this message via email. More information here:
    http://help.yahoo.com/help/us/groups/messages/messages-23.html

<*> To visit your group on the web, go to:  
    http://groups.yahoo.com/group/Programmers-Town/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to