fopen in c

hi! Can anybody help me on accessing files using fopen in c.
I always get different problems like getting null char even if file exist,getting spaces when i read the file.what is handle ? how it is used?

Comments

  • : hi! Can anybody help me on accessing files using fopen in c.
    : I always get different problems like getting null char even if file exist,getting spaces when i read the file.what is handle ? how it is used?
    :
    [code]

    FILE *infile;
    infile = fopen("file.name", "rb");

    [/code]
    This would open the file file.name for binary read mode (the "rb" argument -> Read Binary. "wb" would be Write Binary)
    Than you can use fread (fwrite) for input (output).
  • : hi! Can anybody help me on accessing files using fopen in c.
    : I always get different problems like getting null char even if file exist,getting spaces when i read the file.what is handle ? how it is used?
    :

    [blue]Here is a link that explains the above plus a lot more. Any references to unix will also apply to MS-DOS operating system because I think Bill $$$ "borrowed" many of unix features when he wrote MS-DOS.[/blue]


    http://www.strath.ac.uk/IT/Docs/Ccourse/

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories