0
char *token = "some random string"; 

When I declare this, I know "some random string" is stored in read-only memory. My question is where will read-only memory be? Will it be in the data section or in bss?

unwind
  • 391,730
  • 64
  • 469
  • 606
user2819669
  • 59
  • 2
  • 5

1 Answers1

1

It will be in the data section, BSS is for non-initialized memory.

If using GNU binutils, you can use nm to list the contents of an executable and see in which sections various symbols reside.

unwind
  • 391,730
  • 64
  • 469
  • 606