B
bpascal123
Hi,
In the code below, i'd like to understand why ptr_c doesn't return
something as a value whereas ptr_x returns a number. I understand
ptr_c is of character type
#include <stdio.h>
int main(void)
{
char c, *ptr_c ;
int x, *ptr_x ;
c = 'A' ;
x = 123 ;
printf("\n\nVariable c :\naddress = 0x%p\nvalue = %c\n", &c, c) ;
ptr_c = &c ;
printf("\nPointer ptr_c :\naddress = 0x%p\nvalue = %c\n",
&ptr_c, ptr_c) ;
printf("*ptr_c => %c\n\n\n", *ptr_c) ;
printf("\nVariable x :\naddress = 0x%p\nvalue = %d\n", &x, x) ;
ptr_x = &x ;
printf("\nPointer ptr_x :\naddress = 0x%p\nvalue = %d\n\n",
&ptr_x, ptr_x) ;
printf("*ptr_x => %d\n\n\n", *ptr_x) ;
return 0 ;
}
Is it because i'm simply calling an empty variable value in the
buffer ?
Is this related to the buffer?
Thx,
Pascal
In the code below, i'd like to understand why ptr_c doesn't return
something as a value whereas ptr_x returns a number. I understand
ptr_c is of character type
#include <stdio.h>
int main(void)
{
char c, *ptr_c ;
int x, *ptr_x ;
c = 'A' ;
x = 123 ;
printf("\n\nVariable c :\naddress = 0x%p\nvalue = %c\n", &c, c) ;
ptr_c = &c ;
printf("\nPointer ptr_c :\naddress = 0x%p\nvalue = %c\n",
&ptr_c, ptr_c) ;
printf("*ptr_c => %c\n\n\n", *ptr_c) ;
printf("\nVariable x :\naddress = 0x%p\nvalue = %d\n", &x, x) ;
ptr_x = &x ;
printf("\nPointer ptr_x :\naddress = 0x%p\nvalue = %d\n\n",
&ptr_x, ptr_x) ;
printf("*ptr_x => %d\n\n\n", *ptr_x) ;
return 0 ;
}
Is it because i'm simply calling an empty variable value in the
buffer ?
Is this related to the buffer?
Thx,
Pascal