adamdavies
Programmer
How do i create a new blank xml file with C#
Then populate it with data from textboxes.
thanks
adam
Then populate it with data from textboxes.
thanks
adam
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
/* This is C */
#include <stdio.h>
void writeStrings(char** aList) {
FILE* hfOut = fopen("myfile.xml", "wt");
if (hfOut != NULL) {
fprintf(hfOut, "<?xml version=\"1.0\"?>\n");
fprintf(hfOut, "<MyData>\n");
while (*aList != NULL) {
fprintf(hfOut, "<Data>%s</Data>\n", *aList);
++aList;
}
fprintf(hfOut, "</MyData>\n");
fclose(hfOut);
}
return;
}
// Then call it with:
static char* apszData[] {
"Data One"
, "Data Value Two"
, "More data value (3)"
, NULL
};
writeString(apszData);