Lab 2.2 Running a Hello World Program in C using GCC
1 Goals
The lab helps familiarize you with writing a simple Hello World program using C, the GCC compiler, and Pico(a
text editor). It uses Ubuntu VM created in Lab 2.1.Here is lab objective:
1. Learn to run a program in gcc.
2. Learn to debug a program in gdb.
2 Steps
创建文件
debug_me.c
添加 stdio.h 和 stdlib.h 库文件
创建完成后通过 cat 命令来查看代码内容。
运行
gcc
和
gdb
命令
输入 run "hello,world" "goodbye,world" 将参数传入命令行并观察输出。
评论0