[ create a new paste ] login | about

Link: http://codepad.org/8vYnoiAu    [ raw code | output | fork ]

C, pasted on Jul 5:
1
2
3
4
5
6
7
8
#include <stdio.h>
int main(){
   char* str1="Hello";
   printf("\nstr1: %s, address: %p, sizeof(str1): %u", str1, str1, sizeof(str1));
   str1 = "world";
   printf("\nstr1: %s, address: %p, sizeof(str1): %u", str1, str1, sizeof(str1));
   return 1;
}  


Output:
1
2
3

str1: Hello, address: 0x80485e8, sizeof(str1): 4
str1: world, address: 0x8048619, sizeof(str1): 4


Create a new paste based on this one


Comments: