国外文献检索实战:从平台选择到引文追踪的完整方法论
2026/10/13 16:14:11
以下是一段代码示例及调试过程:
1 #include <stdio.h> 2 static char buf[256]; 3 void read_input(char *s); 4 int main(void) 5 { 6 char *input = NULL; /* Just a pointer, no storage for string */ 7 read_input(input); 8 /* Process command. */ 9 printf("You typed: %s\n", input); 10 /* … */在调试时,可按以下步骤操作:
1. 设置断点:
(gdb) break 7 Breakpoint 2 at 0x804842b: file dbgtst.c, line 7.(gdb) run Starting program: /home/edulaney/sw/dbgtst Breakpoint 1, main () at dbgtst.c:7 7 read_input(input);