printf("%s:%d\n",__FUNCTION__,__LINE__);
时间: 2023-08-26 14:18:25 浏览: 100
一段简单的printf使用示例代码
回答: `printf("%s:%d\n",__FUNCTION__,__LINE__);` 这段代码会输出当前函数名和当前代码所在文件中的行号。函数名可以通过`__FUNCTION__`宏获取,行号可以通过`__LINE__`宏获取。所以这段代码的输出结果会是当前函数名和当前代码所在文件中的行号的组合。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [C语言 —— 预定义符号__FILE____LINE___func__(编写调试函数printf , debug)](https://blog.csdn.net/weixin_42167759/article/details/81138469)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [C++中的三个特殊宏:__FILE__,__FUNCTION__和__LINE__](https://blog.csdn.net/yinxiaohui0212/article/details/116495848)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文