/*test.c 了解C程序的编译*/
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
gcc -o test test.c 或者 gcc test.c -o test
/***例***/
#define PASTE(n) "adhfkj"#n
int main()
{
printf("%s\n",PASTE(15));
return 0;
}
/********输出adhfj15*********/
/*****例*****/
#define NUM(a,b,c) a##b##c
#define STR(a,b,c) a##b##c
int main()
{
printf("%d\n",NUM(1,2,3));
printf("%s\n",STR("aa","bb","cc"));
return 0;
}
/*********最后程序的输出为:aabbcc**********/
gcc -E test.c -o test.i
gcc -S test.i -o test.s
.file "test.c" .section .rodata .LC0: .string "hello world" .text .globl main .type main, @function main: .LFB0: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 movq %rsp, %rbp .cfi_def_cfa_register 6 movl $.LC0, %edi call puts movl $0, %eax leave .cfi_def_cfa 7, 8 ret .cfi_endproc .LFE0: .size main, .-main .ident "GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-4)" .section .note.GNU-stack,"",@progbits
gcc -c test.s -o test.o
ELF > 8 @ @ UH夊? ? ? 擅 hello world GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-4) zR x ? A ?C P .symtab .strtab .shstrtab .rela.text .data .bss .rodata .comment .note.GNU-stack .rela.eh_frame @ ? 0 & X , X 1 X 9 0 d - B ? W ? 8 R ? ? a x � ? test.c main puts ?������
gcc test.o -o test
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有