I’ve looked at the example code provided by the pros team and some other C++ file system tutorials.
All of them require the data to be a const char. What I want is to write a motors velocity to a file. Any ideas I’m stumped? Thanks.
This is what I have right now. I can change what is put in the file with strcpy
but it also only takes a const char.
#include <cstdio>
void opcontrol() {
char str[128];
FILE *fp;
strcpy(str,"love is alweys better yoe\n");
fp = fopen("/usd/file.txt","w");
fputs(str,fp);
strcpy(str,"testing\n");
fputs(str,fp);
fclose(fp);
}
This is a link to the pros docs I looked at.
https://pros.cs.purdue.edu/v5/tutorials/topical/filesystem.html