交流
商城
MCN
登入
注册
首页
提问
分享
讨论
建议
公告
动态
发表新帖
发表新帖
9 结构体
分享
未结
0
949
李延
LV6
2022-06-07
悬赏:20积分
# 结构体 ```c #include <stdio.h> struct Books { char title[50]; char author[50]; char subject[100]; int book_id; }; void pring(struct Books book) { printf("title : %s\nauthor: %s\nsubject: %s\nbook_id: %d\n", book.title, book.author, book.subject, book.book_id); } int main() { struct Books book = {"C books", "RUNOOB", "A programming language", 123456}; pring(book); return 0; } ``` ```asm .file "struct.c" .section .rodata.str1.8,"aMS",@progbits,1 .align 8 .LC1: .string "title : %s\nauthor: %s\nsubject: %s\nbook_id: %d\n" .text .globl pring .type pring, @function pring: .LFB11: .cfi_startproc subq $8, %rsp .cfi_def_cfa_offset 16 movl 216(%rsp), %r8d leaq 116(%rsp), %rcx leaq 66(%rsp), %rdx leaq 16(%rsp), %rsi movl $.LC1, %edi movl $0, %eax call printf addq $8, %rsp .cfi_def_cfa_offset 8 ret .cfi_endproc .LFE11: .size pring, .-pring .section .rodata .align 32 .LC0: .string "C books" .zero 42 .string "RUNOOB" .zero 43 .string "A programming language" .zero 77 .long 123456 .text .globl main .type main, @function main: .LFB12: .cfi_startproc subq $424, %rsp .cfi_def_cfa_offset 432 leaq 208(%rsp), %rdi movl $.LC0, %esi movl $25, %ecx rep movsq movl (%rsi), %eax movl %eax, (%rdi) movq %rsp, %rdi leaq 208(%rsp), %rsi movb $25, %cl rep movsq movl (%rsi), %eax movl %eax, (%rdi) call pring movl $0, %eax addq $424, %rsp .cfi_def_cfa_offset 8 ret .cfi_endproc .LFE12: .size main, .-main .ident "GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-44)" .section .note.GNU-stack,"",@progbits ```
回帖
消灭零回复
提交回复
热议榜
java 相关知识分享
8
好的程序员与不好的程序员
6
写给工程师的十条精进原则
5
spring boot以jar包运行配置的logback日志文件没生成
5
一步一步分析SpringBoot启动源码(一)
5
MockMvc测试
5
【吐槽向】是不是有个吐槽的板块比较好玩
4
logstash jdbc同步mysql多表数据到elasticsearch
3
IntelliJ IDEA 优质License Server
3
.gitignore忽略规则
3
SpringBoot启动源码分析
3
一步一步分析SpringBoot启动源码(三)
3
2
一步一步分析SpringBoot启动源码(二)
2
积分不够将无法发表新帖
2
官方产品
Meta-Boot - 基于MCN
MCN - 快速构建SpringBoot应用
微信扫码关注公众号