首页 \ 问答 \ 如何使用Cruator监听zookeeper事件变化

如何使用Cruator监听zookeeper事件变化

更新时间:2024-02-25 14:02

最满意答案

fprintf是的功能是将数据格式化输出到一个文件中去;
其用法如下:
#include 

    
int fprintf( FILE *stream, const char *format, ... );   
fprintf()函数根据指定的format(格式)(格式)发送信息(参数)到由stream(流)指定的文件.
fprintf()只能和printf()一样工作. 
fprintf()的
 返回值是输出的字符数,发生错误时返回一个负值.
其参数一般都是只有一对的2个参数:一个是已经连接到文件的输出流,另一个是输出流的格式;不过也可以根据需求成对增加,用法和printf一样的。
希望对你有帮助~

其他回答

fprintf
第一个参数是输出流
第二个参数是格式化字符串
第三个和之后参数是变量

如果你会用printf,那么2个是一样的
printf一个是像显示器输出(可以理解为第一个参数省略了)
fprintf是向流里写,指定是哪个流

相关问答

更多
  • fprintf是的功能是将数据格式化输出到一个文件中去; 其用法如下: #include    int fprintf( FILE *stream, const char *format, ... );    fprintf()函数根据指定的format(格式)(格式)发送信息(参数)到由stream(流)指定的文件. fprintf()只能和printf()一样工作. fprintf()的 返回值是输出的字符数,发生错误时返回一个负值. 其参数一般都是只有一对的2个参数:一个是已经连接到文件的输出流,另一 ...
  • 93号线 if( fp = NULL ) 将fp赋值为NULL而不是将其与NULL进行比较。 使用 if( fp == NULL ) 代替。 正如netcoder指出的那样,你的编译器应该警告你。 您也可以在表单if (NULL == fp)编写测试,以便在意外交换比对进行分配时生成编译器错误。 (请注意,有些人可能会发现这种编码风格令人反感,因此可能会在代码审查中产生一些抱怨!) Line 93 if( fp = NULL ) is assigning fp to NULL rather than com ...
  • 使用fdopen创建一个对应于套接字的FILE * ,然后使用fprintf写入它。 Use fdopen to make a FILE * corresponding to the socket, then fprintf to write to it.
  • fprintf会将您的整数数组写为文本,如果这是您想要的,请执行类似的操作 int i; for(i = 0; i < num; i++) fprintf(f,"%d ",tmp_array[i]); fprintf will write the your integer array as text, if that's what you want, do something like int i; for(i = 0; i < num; i++) fprintf(f,"%d ",tmp_arra ...
  • fopen也接受路径,而不仅仅是文件名: myFile = fopen("C:\\blahblah\\myFile.txt", "w");` 如果要使用<<语法,请改用C ++ I / O流。 ostream f("C:\\blahblah\\myFile.txt"); f << vector[k] << endl; fopen accepts also path, not just filename: myFile = fopen("C:\\blahblah\\myFile.txt", "w");` ...
  • 有托管环境和独立环境。 从C标准: 这两种符合实施形式是托管和独立的。 符合托管的实施应接受任何严格符合的程序。 符合独立实施应接受任何严格符合程序,其中使用库条款(第7条)中指定的功能仅限于标准头文件 。 符合条件的实现可能具有扩展(包括附加库函数),前提是它们不会改变任 ...
  • 下面一行是否带有演员表演作品? fprintf(outLeft, "%d: %s \n", (int)iterator->leftRow, iterator->leftDNA); 我怀疑iterator->leftRow 不是 int类型的(或者一些小的类型被自动转换为int )。 如果我是对的,你调用Undefined Behavior ; 在第一种情况下(单独的陈述),没有明显的“不当行为”(不幸运),在第二种情况下,“不当行为”是打印“(NULL)”。 Does the following line ...
  • 它是安全的。 这是C(至少C99,第7.19.6.1段)所说的 如果参数保留时格式已用尽,则应评估多余的参数,否则将忽略这些参数。 如果目标是避免一条线,我宁愿这样做 fflush(stdout); fprintf(stdout, "message"); 如果只是为了防止这个人后来阅读那个代码用蝙蝠打猎我。 It's safe. Here's what C (C99 atleast, paragraph 7.19.6.1) says about it If the format is exhausted ...
  • _tprintf和_ftprintf将与TCHAR格式字符串一起使用。 TCHAR只是一个宏,可以解析为char或wchar_t ,具体取决于是否定义了_UNICODE宏。 所以,基本上,如果你没有定义_UNICODE , _ftprintf将等同于fprintf ,否则它将等同于fwprintf 。 _tprintf and _ftprintf are to be used with TCHAR format strings. TCHAR is just a macro, which unwraps in ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。