tdeepcopy.nim 291 B

12345678910111213141516171819
  1. discard """
  2. output: '''13 abc'''
  3. """
  4. type
  5. PBinaryTree = ref object
  6. le, ri: PBinaryTree
  7. value: int
  8. proc main =
  9. var x: PBinaryTree
  10. deepCopy(x, PBinaryTree(ri: PBinaryTree(le: PBinaryTree(value: 13))))
  11. var y: string
  12. deepCopy y, "abc"
  13. echo x.ri.le.value, " ", y
  14. main()