Skip to content
Snippets Groups Projects
Commit 6553afd4 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Beispiele, Tafelbild und Screenshot 25.3.2025

parent 75d4fb80
Branches
No related tags found
No related merge requests found
#include <stdio.h>
int main (void)
{
char a[] = "Test";
char *p = "Test";
printf ("%s\n%s\n", a, p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[] = "Test";
char *p = "Test";
printf ("%d %d %d %d\n", &a, a, &p, p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[] = "Test";
char *p = "Test";
printf ("%z %z %z %z\n", &a, a, &p, p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[] = "Test";
char *p = "Test";
printf ("%zd %zd %zd %zd\n", &a, a, &p, p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[] = "Test";
char *p = "Test";
printf ("%zd %zd %zd %zd\n", (size_t) &a, (size_t) a, (size_t) &p, (size_t) p);
return 0;
}
#include <stdio.h>
int main (void)
{
char a[] = "Test";
char *p = "Test";
printf ("%016zx %016zx %016zx %016zx\n", (size_t) &a, (size_t) a, (size_t) &p, (size_t) p);
return 0;
}
20250325/arrays-and-pointers-06.png

86.3 KiB

.file "arrays-and-pointers-06.c"
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Test"
.LC1:
.string "%016zx %016zx %016zx %016zx\n"
.section .text.startup,"ax",@progbits
.p2align 4
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
subq $24, %rsp
.cfi_def_cfa_offset 32
leaq .LC0(%rip), %r8 ; #include <stdio.h>
leaq .LC1(%rip), %rdi ;
xorl %eax, %eax ; int main (void)
leaq 3(%rsp), %rsi ; {
leaq 8(%rsp), %rcx ; char a[] = "Test";
movb $0, 7(%rsp) ; char *p = "Test";
movq %rsi, %rdx ; printf ("%016zx %016zx %016zx %016zx\n", (size_t) &a, (size_t) a, (size_t) &p, (size_t) p);
movl $1953719636, 3(%rsp) ; return 0;
movq %r8, 8(%rsp) ; }
call printf@PLT ; 1953719636 = 0x74736554
xorl %eax, %eax ; t s e T
addq $24, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.ident "GCC: (Debian 12.2.0-14) 12.2.0"
.section .note.GNU-stack,"",@progbits
File added
20250325/screenshot-20250325-120044.png

169 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment