Jump to content
munny

Writing to a file

Recommended Posts

Hello,

I'm trying to write to a file and then reading back from it. I'm using code composer studio. After execution, I can see a file is created but nothing is written in it (Didn't get any error). Below is the code. What is the possible issue here? I omit the reading part as I couldn't able to write. 

#include <msp430.h>
#include <stdio.h>


void main()
{
    WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT

    FILE *fread;
    fread= fopen("testing", "w");  // not sure if I should add the file extention here like testing.txt but I tried including the extension also
    fprintf(fp, "Writing\n");
    fclose(fp);

}

 

Thanks,

Row

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...