Machine Based Calculator : Inpre C Source Code Version 1.2.4


  1. #include "inpre.h"
  2. #include "stdlib.h"
  3. #include <math.h>
  4.  
  5.  
  6. void createStacki(Stackint *S)
  7. {
  8.         (*S).top = nil;
  9. }
  10.  
  11. adiStack alokasiStacki(infoint x)
  12. {
  13.         adiStack p = (adiStack) malloc(sizeof(ElmtStackint));
  14.         p>info = x;
  15.         p>next = nil;
  16.         return p;  
  17. }
  18.  
  19.  
  20. void pushi(Stackint *S, infoint x)
  21. {
  22.         adiStack p;
  23.         p = alokasiStacki(x);
  24.         p>next = S>top;
  25.         S>top = p;
  26. }
  27.  
  28. void popi(Stackint *S, adiStack *p)
  29. {  
  30.         *p = S>top;
  31.         S>top = S>top>next;
  32. }
  33.  

One thought on “Machine Based Calculator : Inpre C Source Code Version 1.2.4

  1. Pingback: Tugas Besar “Machine Based Calculator” : Kalkulator Konversi Infix ke Postfix dan Prefix « The TWOH's Computer Engineering and Science

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s