cyberking

[C] Pointer show Structure

Mar 13th, 2016
607
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include<iostream.h>
  2. #include<conio.h>
  3.  
  4. struct Node
  5. {
  6. int NilaiUTS;
  7. int NilaiUAS;
  8. int N1, N2;
  9. };
  10.  
  11. Node *P, *Q;
  12.  
  13. main()
  14. {
  15. clrscr();
  16. P = new Node;
  17. P -> N1 = 99;
  18.  
  19. Q = new Node;
  20. Q -> N2 = 78;
  21.  
  22. cout<<endl;
  23. cout<<" nilai P : "<< P -> N1 <<endl;
  24. cout<<" nilai Q : "<< Q -> N2 <<endl;
  25. cout<<endl;
  26. getch();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment