如何打印到.txt file我已创建的空白?
我已经将结果打印到控制台,现在我想打印到一个名为的文件"Output.txt".我尝试了一些没有用的东西,但我认为创建一个printDictionary()专门用于打印到一个名为的文件的副本更容易printDictionaryToFile().虽然如此,我有点迷失方向.谁能纠正我的错误?我已经为文件添加了一个FILE名为*out输出的额外类型.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stddef.h>
#define PUNC " \t\n\r,;.:!()[]{}?'\""
typedef struct node node;
typedef struct node {
char *word;
int count;
node *left;
node *right;
} node;
void insert(node ** dictionary, char * word) {
int result;
node * entry;
if (word == NULL || dictionary == NULL)
return;
if (*dictionary == NULL) {
entry= (node *) malloc(sizeof(node));
strcpy( entry->word= …Run Code Online (Sandbox Code Playgroud)