Keep Leading zeros C

后端 未结 2 1927
故里飘歌
故里飘歌 2021-01-25 03:22

I am trying to read the memory addresses from /proc//maps and I use the following code

for (ptr = NULL; getline(&ptr, &n, file) > 0;)     {
   if (ptr         


        
2条回答
  •  一整个雨季
    2021-01-25 04:20

    Use the 0 flag (which specifies leading zeros), followed by the padded length.

    printf("r0: %08lx, r1: %08lx\n", r0, r1);
                 ^^         ^^
    

    This link is a good reference to look at.

提交回复
热议问题