1 //===-- main.c --------------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include <stdio.h> 10 #include <stdlib.h> 11 #include <string.h> 12 13 struct referent { 14 const char *p; 15 }; 16 17 int main (int argc, char const *argv[]) 18 { 19 const char *my_ptr = strdup("hello"); 20 struct referent *r = malloc(sizeof(struct referent)); 21 r->p = my_ptr; 22 23 printf("%p\n", r); // break here 24 25 return 0; 26 } 27