在 vscode 中使用 C++ 进行调试时读取输入
摘要:在launch.json中启用 “externalConsole”:true,则将获得一个弹出的控制台窗口,可以在其中键入 参照: https://stackoverflow.com/questions/57494832/how-to-read-input-when-debugging-in-c-i
阅读全文
vscode step into出现Could not load source './malloc/./malloc/malloc.c': 'SourceRequest' not supported..
摘要:问题: 使用step into调试c语言内建函数时就会出现 解决: 1.使用step over跳过调试c语言内建函数 2.将launch.json的工作目录设置为c库目录 对于debian系统 sudo apt install glibc-source cd /usr/src/glibc/ sudo
阅读全文
c语言的一些类型声明符
摘要:基本类型: char: 字符类型 int: 整数类型 float: 单精度浮点数类型 double: 双精度浮点数类型 void: 无类型 修饰符: short: 短整数类型 long: 长整数类型 signed: 有符号类型 unsigned: 无符号类型 复合类型: struct: 结构体类型
阅读全文
c语言的printf常用的一些转换说明符及其含义
摘要:整数类型: %d: 十进制整数 (decimal: 十进制的) %u: 无符号整数 (unsigned: 无符号的) %i: 十进制整数 (integer: 整数) %o: 八进制数 (octal: 八进制的) %x: 十六进制数 (hexadecimal: 十六进制) 浮点数类型: %f: 浮点数
阅读全文