O
Old Wolf
Is this program guaranteed to print 10, or can the compiler
get 'confused' by the const and assume the variable
still has its initial value?
#include <stdio.h>
int func(int *A, int const *B)
{
*A = 10;
return *B;
}
int main()
{
int X = 5;
printf("%d\n", func(&X, &X));
}
get 'confused' by the const and assume the variable
still has its initial value?
#include <stdio.h>
int func(int *A, int const *B)
{
*A = 10;
return *B;
}
int main()
{
int X = 5;
printf("%d\n", func(&X, &X));
}