• How to read and write to files in C?

    From Deavmi@VERT/TECHQRY to All on Wed Nov 25 22:04:36 2015
    Could somebidy show me how to read and write to files in C and also explain the code as well as that is very important.

    Thanks in advance.

    ---
    þ Synchronet þ TechnoQuarry BBS
  • From echicken@VERT/ECBBS to Deavmi on Thu Nov 26 00:56:54 2015
    Could somebidy show me how to read and write to files in C and also explain the code as well as that is very important.

    http://goo.gl/ujuhpG

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230

    ---
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From Xucaen@VERT/TIMEPORT to Deavmi on Thu Nov 26 05:36:43 2015
    Could somebidy show me how to read and write to files in C and also explain the
    code as well as that is very important.

    Thanks in advance.


    For when you are read, I don't know if you are on a Windows OS or Linux, but you can get a free version of Visual Studio from Microsoft.

    https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx

    happy coding!

    ---
    þ Synchronet þ The Time Portal - timeport.synchro.net:2112 - Celebrating the past from the futu
  • From Khelair@VERT/TINFOIL to Deavmi on Fri Nov 27 18:15:04 2015
    Re: How to read and write to files in C?
    By: Deavmi to All on Wed Nov 25 2015 14:04:36

    Could somebidy show me how to read and write to files in C and also explain the code as well as that is very important.

    First command you need to learn (and I believe these are all in stdio.h and/or stdlib.h) is 'fopen()'... did I say command I meant function... If you're on a linux system that has the right manpages 'man fopen' will bring you up a concise little guide on it.
    For reading, so long as it's not to be worked with purely as text, you want to look up next 'fread()', then for writing it's 'fwrite()'. So man fread & man fwrite to see those.
    C is a stickler, too. Make sure you use fclose() when you're done on that filehandle, too.
    If you're not on a linux system you should be able to google these commands along with a capital 'C' and find either the appropriate manpages online or else a good tutorial that covers the applicable material. In fact googling 'C file IO tutorial' might be a good idea (of course I remember it after typing all of this).

    -D/K

    ---
    Borg Burgers: We do it our way; your way is irrelevant.
    þ Synchronet þ Tinfoil Tetrahedron BBS telnet://tinfoil.synchro.net
  • From Deavmi@VERT/TECHQRY to Khelair on Sat Nov 28 10:06:36 2015
    Re: Re: How to read and write to files in C?
    By: Khelair to Deavmi on Fri Nov 27 2015 10:15 am

    Re: How to read and write to files in C?
    By: Deavmi to All on Wed Nov 25 2015 14:04:36

    Could somebidy show me how to read and write to files in C and also explain the code as well as that is very important.

    First command you need to learn (and I believe these are all in stdio.h and/or stdlib.h) is 'fopen()'... did I say command I meant function... If you're on a linux system that has the right manpages 'man fopen' will bring up a concise little guide on it.
    For reading, so long as it's not to be worked with purely as text, you wan to look up next 'fread()', then for writing it's 'fwrite()'. So man fread & man fwrite to see those.
    C is a stickler, too. Make sure you use fclose() when you're done on that filehandle, too.
    If you're not on a linux system you should be able to google these command along with a capital 'C' and find either the appropriate manpages online or else a good tutorial that covers the applicable material. In fact googling file IO tutorial' might be a good idea (of course I remember it after typing all of this).

    -D/K

    Wow, thanks a lot. I never knew you could do man `C function`; thanks a lot. :)

    ---
    þ Synchronet þ TechnoQuarry BBS