AI大模型、AIGC与算力:核心技术解析与应用指南
2026/7/26 23:57:34
以下是一段代码示例及调试过程:
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);