Dear Sirs,
This is my first message in this forum. I want to make this easy for all. I am struggling with an issue in VSCode in Windows 11
For a long time studied with VSCode in Ubuntu just did some codes after a while for migration for cross platforms just passed to the Windows. For describing this issue i am giving a small code sample to define what i have been encountering in VSCode. Just summurizing the issue with an code:

Code:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int foo(int *value,char **text){
    char a[]="hello World";
    *text=a;
    *value=2;
    return(0);
}
int main(){
    int a=1;
    char *ptr;
    foo(&a,&ptr);
    printf("%d %s",a,ptr);
    getchar();
    return(0);
}
While taking a refference from a function previously there were any kind of problem in Ubuntu. The code above was working so clear. So far so good then try to perform the same code in Windows. When i run the code accepted output value must be:
"hello World" but in Windows just taking the "2 hell" console output. Obviously i have an headace in Windows now. For clearifying event i captured the last machine status of VSCode debugger for revealing what i am doing wrong or right. Any ideas or options for this issue
I would be very glad for the assist

C function argument and return values-untitled-jpg
After calling the function and returning back to the main loop there are any kind of variable error till using the printf function.