Skip to content

Parameter mutations within functions are not shown #23

Open
@pgbovine

Description

@pgbovine

it seems like parameters being reassigned inside a function aren't reflected in the visualizer

bug report:

Hello,
In the below program after the ptr is loaded with &x,it should point to x,but the visualizer is not doing that ,but the output is right i.e 21 .Can you please explain me why this is happening ?Is it because of somebug or something else?

#include <stdio.h>
 
int fun(int ptr[])
{
   int x = 21;
 
   // size of a pointer is printed
   printf("sizeof(ptr) = %d\n", sizeof(ptr));
 
   // This allowed because ptr is a pointer, not array
   ptr = &x;
 
   printf("*ptr = %d ", *ptr);
 
   return 0;
}
int main()
{
   int arr[] = {10, 20, 30, 40, 50, 60};
   fun(arr);
   return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions