你能帮我解决下面的C问题吗?我试图打印一个包含30个连续值的列表,从某个内存地址开始.我想在每个内存位置打印1个字节作为十六进制.作为要插入的内存地址的指示,我在程序开始时打印虚拟地址.
问题是我得到的值超过1个字节.对于长序列的零,这仍然会产生00,但是一旦出现非零值,我就会得到一个4字节"窗口"的打印.这导致以下输出:
Main function address is 0x8048494
Dummy variable address is 0x9a2e008
Enter the address (without the 0x):9a2e008
You entered: 9a2e008
Address Byte value
0x9a2e008 00
0x9a2e009 00
0x9a2e00a 00
0x9a2e00b 00
0x9a2e00c 00
0x9a2e00d 00
0x9a2e00e 00
0x9a2e00f 00
0x9a2e010 00
0x9a2e011 f1000000
0x9a2e012 ff10000
0x9a2e013 20ff100
0x9a2e014 20ff1
0x9a2e015 3900020f
0x9a2e016 61390002
0x9a2e017 32613900
0x9a2e018 65326139
0x9a2e019 30653261
0x9a2e01a 30306532
0x9a2e01b 38303065
0x9a2e01c 383030
0x9a2e01d 3830
0x9a2e01e 38
0x9a2e01f 00
0x9a2e020 00
0x9a2e021 00
0x9a2e022 00
0x9a2e023 00 …Run Code Online (Sandbox Code Playgroud) 我刚刚开始使用Netbeans 7.3.1,我在编译项目时遇到了一些麻烦.在终端中,我使用以下代码成功编译:
gcc -Wall one.c two.c three.c four.c -o gateway -lpthread
Run Code Online (Sandbox Code Playgroud)
当我在Netbeans中编译时,我得到的错误就像'未定义引用'pthread_create'.所以我需要添加' -lpthread '选项,但我无法弄清楚...
任何帮助将非常感激!!
编辑:发现它:我发布了下面的解决方案!
亲切的问候,
乔