Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在c中将consloe输出打印到一些.txt文件中_C - Fatal编程技术网

如何在c中将consloe输出打印到一些.txt文件中

如何在c中将consloe输出打印到一些.txt文件中,c,C,如何将所有这些控制台输出打印到c中的某个.txt文件中,这样每当我调用该函数时,它都会打印到txt文件中,而不是在控制台中打印。由于您的标记是c,您可以在附加模式下打开一个文件,而不是使用printf,您可以使用fprintf和fwrite以及类似的文件句柄。因为您的标记是c,您可以在附加模式下打开一个文件,而不是使用printf,您可以使用fprintf和fwrite以及类似的文件句柄。一个简单的方法是在shell中编写如下内容: Min Profile Cycles [215914] Ma

如何将所有这些控制台输出打印到c中的某个.txt文件中,这样每当我调用该函数时,它都会打印到txt文件中,而不是在控制台中打印。

由于您的标记是c,您可以在附加模式下打开一个文件,而不是使用printf,您可以使用fprintf和fwrite以及类似的文件句柄。

因为您的标记是c,您可以在附加模式下打开一个文件,而不是使用printf,您可以使用fprintf和fwrite以及类似的文件句柄。

一个简单的方法是在shell中编写如下内容:

Min Profile Cycles  [215914]
Max Profile Cycles  [934625]
Max Profile         [23]
Max Profile Count   [4]

一种简单的方法是在shell中编写如下内容:

Min Profile Cycles  [215914]
Max Profile Cycles  [934625]
Max Profile         [23]
Max Profile Count   [4]

不使用stdout但使用f.e.stderr并将错误通道重定向到textfile的可能重复项不使用stdout但使用f.e.stderr并将错误通道重定向到textfile的可能重复项在我的情况下,prinf由于内存限制而被禁用,在这种情况下,如何打印valyes。在我的情况下,prinf基本上由于内存限制在这种情况下如何打印valyes。