why do i get the same value of the address?

后端 未结 4 1747
无人共我
无人共我 2020-12-11 07:13
#include
#include

void vaibhav()
{
    int a;
    printf(\"%u\\n\",&a);
}

int main()
{
    vaibhav();
    vaibhav();
    vaibhav(         


        
4条回答
  •  借酒劲吻你
    2020-12-11 07:48

    You should use %p format specifier to print address of a variable. %u & %d are used to display integer values. And the address on stack can be same or not every time you call function vaibhav().

提交回复
热议问题